Forum Moderators: phranque
/claus
<script type="text/javascript">var IEstring = "<a href='javascript:window.external.AddFavorite"
IEstring += "(location.href,document.title);'>Click here to bookmark this page!<\/a>" ;
var NSstring = "Click [Ctrl + D] to bookmark this page!";
var OTHstring = "Remember to bookmark this page!"
var whichString = OTHstring ;
var agt = navigator.userAgent.toLowerCase();
var app = navigator.appName.toLowerCase();
var ieAgent = agt.indexOf('msie');
var nsAgent = app.indexOf('netscape');
if (ieAgent != -1) {
whichString = IEstring;
} else if (nsAgent != -1){
whichString = NSstring;
}
document.write("<b>" + whichString + "</b>")
</script>
To add to favorites:
<span style='cursor:hand;text-decoration:underline;'onclick='window.external.AddFavorite(location.href,document.title);'>
Click to add this page to your favorites list</span>
To set homepage:
<span style='cursor:hand; color:blue; text-decoration:underline'
onClick='this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.yourdomain.com');'>
Click to set this page as your homepage</span>
HTH..
- Chad
<a href="#" onClick="this.style.behavior='url(#default#homepage)';
this.setHomePage(location.href);">Set homepage</a> The difference from the above is that here it is a link, in the above post it is a "span".
oh.. and i use the location.href, so you can just drop it on any page :)
oh..again.. i just saw what went wrong...the '-character should be an " in SlyGuys example
- here: onClick='this.style (after =)
- and here: yourdomain.com');'> (just the one before > )
I think SlyGuys example will work as well if You replace the two 's
/claus