...

View Full Version : Set As Homepage Link Script



iChick
05-01-2008, 04:22 AM
Hi

I'm trying to write a script that sets as homepage in IE but links to a url in all other browsers. The url will be a page which gives information on how to set the homepage in Firefox, Opera, Safari etc. It's not working though. I'd really appreciate any pointers as to where I'm going wrong. Here's what I have:



<script>
function setHome() {
this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.mysite.com')"; else{location.href='/set_homepage_info.html'}}
</script>

<a href="javascript:setHome()">Set As Homepage</a>

A1ien51
05-01-2008, 04:43 AM
You have no if that goes with the else.

Eric

iChick
05-01-2008, 03:24 PM
Doh! I can't believe I left that out. The if is in my original script but I forgot to copy and paste it. Script below as is but it's still not working:


<script>
function setHome()
{if(document.all)
this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.mysite.com')"; else{location.href='/set_homepage_info.html'}}
</script>

<a href="javascript:setHome()">Set As Homepage</a>

This is the usual set homepage link that I'm trying to modify if it helps:


<a href="#"
onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.mysite.com');">Set As Homepage</a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum