Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page




 

JavaScript bookmark

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>

Index

Category:
Cool Tricks

Companies:
None

Related Pages:
HTML Help

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope