|
Example
The below source will add the above link for viewers of your web page to add your
page to their bookmarks. This code will only work in Internet Explorer but will still
display a message saying to bookmark your site in Netscape.
Source code
<p><script
LANGUAGE="Javascript">
<!-- Begin
if ((navigator.appName == "Microsoft Internet
Explorer") && (parseInt(navigator.appVersion) >= 4)) {
var url="http://www.computerhope.com";
var title="Computer Hope";
document.write('<A HREF="javascript:window.ext');
document.write('ernal.AddFavorite(url,title);" ');
document.write('onMouseOver=" window.status=');
document.write("'Add our site to your favorites!'; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('">Add our site to your favorites!</a>');
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += " (CTRL-D)";
document.write(msg);
}
// End -->
</script></p> |