Results 1 to 2 of 2

Thread: Help on google set homepage script

  1. #1
    Join Date
    May 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help on google set homepage script

    I was redirected by someone to Javascript for help, as of right now, no solution was found yet in php section.

    Here is what I wanted to achieve, exactly like google did.

    1. When visitors come to the website, they see a "set it to my homepage" link
    2. After user clicks on that link and confirms, the link will disappear. However, if next time when you visit the site, the homepage is altered, then the link will appear again.

    There must be some kind of condition checking in the code. I tried to understand this not-so-complicated page, even set up a redirect page mgyhp.html to direct to index.html, however, no luck in successing. The link appears all the time in explorer even after setting the homepage.

    <span id=hp style="behavior:url(#default#homepage)"></span>
    <script>
    //<!--
    if (!hp.isHomePage('http://www.google.com/')) {document.write("<p><a href=\"/mgyhp.html\" onClick=\"style.behavior='url(#default#homepage)';setHomePage('http://www.google.com/');\">Make Google Your Homepage!</a>");}
    //-->
    </script>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You already have a thread open for this in DD Help, please restrict yourself to one active thread.

    http://www.dynamicdrive.com/forums/s...7992#post37992
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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