#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Location
    London
    Posts
    110
    Rep Power
    0

    setting homepage with javascript


    anyone know how to set the homepage in IE on a mac using javascript.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    la, ca
    Posts
    84
    Rep Power
    14
    <a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.whatever.com');">set the homepage</a>

    This works for the PC. Don't know if it's different on the Mac, but you can give it a shot.
  4. #3
  5. No Profile Picture
    drone
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    sector 7G
    Posts
    3
    Rep Power
    0
    is there any way to accomplish the same thing using a function instead of using the onclick method?

    like:
    Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function bookmarkUs(it){
    	it.style.behavior='url(#default#homepage)';
    	it.setHomePage('http://myDomain.net');
    }
    -->
    </script>
    
    
    <a href="javascript: bookmarkUs(this);">make us home</a>
    btw: I'm fully aware that this code doesn't work... I just don't know why... I'm sure the main reason is my n00b status.
  6. #4
  7. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function bookmarkUs(oLink){
    	oLink.style.behavior='url(#default#homepage)';
    	oLink.setHomePage('http://myDomain.net');
    	return false;
    }
    //-->
    
    <a href="javascript&#58;;" onclick="return bookmarkUs(this)">make us home</a>
  8. #5
  9. No Profile Picture
    drone
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    sector 7G
    Posts
    3
    Rep Power
    0

    Unhappy


    hmm... this function gives me the same error as my function. it seems like you just changed the variable name. the return false statement seems to have no effect on it.

    thanks for the quick reply though.

    This is the error I am recieving.

    Error: 'style' is null or not an object
  10. #6
  11. No Profile Picture
    drone
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    sector 7G
    Posts
    3
    Rep Power
    0
    oops...

    that part above about your function not working, well, strike that.

    if I would've look closer I would've seen that you had the function call in the onClick method, not the href.

    :embarrased:


    thanks again.

IMN logo majestic logo threadwatch logo seochat tools logo