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.

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.

For this to work, you need to change all the references to your page, not Google's. These references must all be identical (and probably include the absolute path - http://whatever) and might not work locally, only live. Finally, this is IE only code. If you view Google in other browsers, it doesn't work.

Twey

05-29-2006, 10:21 AM

Why the heck did MS decide to implement this as CSS?! It makes no sense at all!

jscheuer1

05-29-2006, 07:28 PM

To answer Twey's question -

So that it would be ignored by all (specifically earlier IE) browsers that do not support it without causing a script error. This may no longer be strictly the case in recent FF releases but, if there is an error, it would be a style error. Needless to say, this type of style probably will not validate.

I also should have added to my above post that this code probably must be on the same page that it references.

pistolpapa

05-30-2006, 10:01 AM

For this to work, you need to change all the references to your page, not Google's. These references must all be identical (and probably include the absolute path - http://whatever) and might not work locally, only live. Finally, this is IE only code. If you view Google in other browsers, it doesn't work.

Yes, I tried changing the references to my website, and I'm testing it only on IE. It does work to set the homepage, however, it doesn't disappear as the code indicates or the google webpage does, so even if I clicked on the link and set the homepage, it's still always there. Interesting huh? I've tried almost everything, but couldn't figure out what goolge did to this code and to get it work.

Twey

05-30-2006, 11:15 AM

So that it would be ignored by all (specifically earlier IE) browsers that do not support it without causing a script error.But an attribute could be used just as well.

jscheuer1

05-30-2006, 04:43 PM

Yes, I tried changing the references to my website, and I'm testing it only on IE. It does work to set the homepage, however, it doesn't disappear as the code indicates or the google webpage does, so even if I clicked on the link and set the homepage, it's still always there. Interesting huh? I've tried almost everything, but couldn't figure out what goolge did to this code and to get it work.

Have you tested it live? I think it needs to be on the server in order to know that the page set is the actual page. If you do have it live and are still having problems, give us a link to the page so we can check it out.

pistolpapa

05-31-2006, 05:15 AM

I've tested it live on the server. The code is as following, however, it doesn't work in IE, in which the "set homepage" link never disappears. And it doesn't work in firefox either, which doesn't show the link at all.

must be changed to your domain or page and be identical to each other as well as to the domain root or (if doing a page) to the address that shows in the address bar. It must be live on the page. If you are doing a domain, it must be live in the root of the domain. As mentioned before, it is IE only. Of course, you should also change:

Make Google Your Homepage!

To text appropriate to your page or domain.

You can also do the root of a subdirectory, following all the same rules as though it were a domain. That last part I only tested on a domain name server so, it may not work if you have a directory on say freewebs or something like that.

pistolpapa

05-31-2006, 07:22 AM

I did the same thing! If you go back to the first post of this thread, you see i have the same piece of code. However, it doesn't disappear after you click on the link. And I did change the google.com part to my own domain name.

Does your link disappear after you set the page to be your homepage?

jscheuer1

05-31-2006, 07:30 AM

Yes it disappears. Post a link to your page.

And look again, the code is not identical.

pistolpapa

05-31-2006, 08:06 AM

Yes it disappears. Post a link to your page.

And look again, the code is not identical.

I was gonna say John you the man!
Then,
Dunno if I did something wrong(I copied and pasted the code into the body of my code), but it doesn't work. The botton of the screen also says "error". You think it's possible to show us your page/link?

pistolpapa

05-31-2006, 08:07 AM

When I say disappear I meant,
if the homepage is google.com already, then the page will still show, but just the link itself disappear, any kind of redirect of pages doesn't count. Just wanna clarify.

jscheuer1

05-31-2006, 08:23 AM

I made a typo in the second 'location', leaving out the 'a'. This is what caused the error which then cascades into other problems. Here is a working version of my code, the address used is the live page, the link appears in the upper left corner of the page on a dark background, so is hard to see but, it is there:

Once you get the code corrected on your page, make sure to clear your cache, reload, and make sure there is no hash (#) in the address bar.

pistolpapa

05-31-2006, 08:37 PM

John you the Man!
I tried it and it worked perfectly. I'm sure this piece of code will benefit a lot of people who come here.

jscheuer1

06-01-2006, 05:46 AM

Thanks. I was playing around with this just a bit more and discovered there were errors in FF and Opera. Nothing that would 'stop the show' but annoying to any purist. Plus, this code would make any page not validate. If you put IE conditional comments around it, all that goes away and it still works fine in IE, I also added variables that allow you to configure the page or domain and text shown in just one spot (highlighted red):