www.webdeveloper.com
Results 1 to 3 of 3

Thread: this.setHomePage(avariable) help?

  1. #1
    Join Date
    Jan 2003
    Location
    uk
    Posts
    5

    this.setHomePage(avariable) help?

    <a HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage(http://myweb.com);"><img src="images/house.gif" width="18" height="20">
    Click here to make this your default homepage!</a>

    Using the above code works just fine BUT I want to use a variable after the this.setHomePage which is dynamically assigned with the url of the page.

    The url can be obtained from a header as in ASP I assume...

    Anyway I cannot seem to use a variable - only text as in this.setHomePage(http://www.myweb.com)

    I want this: this.setHomePage(myvar) to work...

    Thanks

  2. #2
    Something like this maybe:
    if(document.all)
    {
    document.write('<a href="#" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\location.href);">Click here to make My Site your default homepage</a>')
    document.write('<br><br>')
    }

    You should also know that none of the Mozilla browsers support this feature.

  3. #3
    Join Date
    Jan 2003
    Location
    uk
    Posts
    5

    Thank you Mr!

    Hey that works a treat - thank you very much! Pat yourself on the back and give yourself an extra beer.

    Daniel

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles