/ Published in: JavaScript

There is no standard for this at all - this just looks for the hooks that exist in IE and gecko-type browsers.
See also http://msdn.microsoft.com/en-us/library/ms535926(VS.85).aspx and http://developer.mozilla.org/en/docs/DOM:window.sidebar
See also http://msdn.microsoft.com/en-us/library/ms535926(VS.85).aspx and http://developer.mozilla.org/en/docs/DOM:window.sidebar
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function addToBookmarks(url,title) { if (window.external && window.external.AddFavorite) window.external.AddFavorite(url,title); // IE4 and later else if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(title,url,''); // Gecko/firefox } //use e.g. like: addToBookmarks(window.document.location, window.document.title);
Comments
