Reply LinkBack Thread Tools Search this Thread
Old 25-03-2008, 08:33   #1 (permalink)
webfunkin
Web Hosting Provider
 
Join Date: Jan 2008
Posts: 30
Script needed: Set this site as your home page

Hey,

I have been trying to set up a button (image) which allows the user to set a website as their browser homepage. I have tries to figure it out, even googled, but failed miserably.

As far as I can see this is possible only in IE. So there has to be a browser detection script attached. So, if the user is using IE, then he is shown the button along with manual instructions to set it as their home page. If he (excuse me for my gender bias) is using some other browser, then manual instructions for the same are shown.

Can someone give me an example on how to do this? Just the script will be enough.

Thanks....
  Reply With Quote
Old 25-03-2008, 10:32   #2 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 744
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Browser detection is becoming an outdated (and unreliable) practice more and more these days. Instead, you should be looking at Object Detection for the functionality that you require.

Basically, if your visitors' User Agent supports the bookmarking object (addFavorite) then show the button, otherwise display a 'manual' message instead. The bookmarking object is currently supported in IE, Mozilla/Firefox, and Opera.

If you Google for "addFavorite" then you should get enough results and guidance to be able to write the script...

- Mike

Edit: This page might be especially useful - http://labnol.blogspot.com/2006/01/a...k-firefox.html
__________________
  Reply With Quote
Old 25-03-2008, 10:46   #3 (permalink)
webfunkin
Web Hosting Provider
 
Join Date: Jan 2008
Posts: 30
thanks for that link.
  Reply With Quote
Old 25-03-2008, 11:14   #4 (permalink)
webfunkin
Web Hosting Provider
 
Join Date: Jan 2008
Posts: 30
btw, that only helps in adding as a favorite, not setting the site as the homepage..
  Reply With Quote
Old 25-03-2008, 11:17   #5 (permalink)
Anxious
On the Naughty Step
 
Anxious's Avatar
 
Join Date: Jun 2007
Location: Glasgow
Posts: 1,300
A quick google leads me to this script, which only seems to work in IE:

Code:
<a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://yoursi.te');">Click here to make this site your default homepage</a>
  Reply With Quote
Old 25-03-2008, 11:18   #6 (permalink)
webfunkin
Web Hosting Provider
 
Join Date: Jan 2008
Posts: 30
works only in ie 5.0 (which is as good as obsolete)
  Reply With Quote
Old 25-03-2008, 11:27   #7 (permalink)
Anxious
On the Naughty Step
 
Anxious's Avatar
 
Join Date: Jun 2007
Location: Glasgow
Posts: 1,300
Quote:
Originally Posted by webfunkin
works only in ie 5.0 (which is as good as obsolete)

It's supposed to work in I.E 5 and above, not just 5.0.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8