Bookmarks: Add Favorite
This page is obsolete and retained for archival purposes only.
Question: How do I invoke the browser's Add Favorite dialog?
Answer:
In Internet Explorer 4.0 and newer versions, you can invoke the browser's Add Favorite dialog
by calling the method
Example: In Internet Explorer, this script creates a hyperlink that displays the Add Favorite dialog. In other browsers, the script reminds the user to create a bookmark by clicking Bookmarks | Add bookmark or press Ctrl+D. if (navigator.appName.indexOf("Microsoft")==-1) {
document.write (
'To bookmark this site, click '
+'<b>Bookmarks | Add bookmark</b> '
+'or press <b>Ctrl+D</b>.'
)
}
else if (parseInt(navigator.appVersion)>3) {
document.write (''
+'<a '
+' onMouseOver="self.status=\'Bookmark this site\'" '
+' onMouseOut="self.status=\'\'" '
+' href="javascript:window.external.AddFavorite'
+'(\'http://www.JavaScripter.net/faq/\','
+'\'JavaScripter.net FAQ\')">'
+'Click here to bookmark this site</a>.'
)
}
See also other JavaScript dialogs: |
Copyright © 1999-2011, JavaScripter.net.