I used this script:
function addBookmark(url, title)
{
if (!url) url = location.href;
if (!title) title = document.title;
if (window.external)
window.external.AddFavorite(url, title)
if (window.sidebar)
window.sidebar.addPanel(title, url, "");
//Opera7+
else if (window.opera && document.createElement)
{
var a = document.createElement('A');
if (!a) return false; //IF Opera 6
a.setAttribute('rel','sidebar');
a.setAttribute('href',url);
a.setAttribute('title',title);
a.click();
}
else
{
return false;
}
}
Worked perfectly in IE6, Opera8,9, FF1.5 and etc. Now I am not sure when, but FF ceased to work, I have 2.0.0.1 installed and I am not sure if it is branch 2 that doesnt work or it stopped working prior to releaseing FF2. This snippet is for FF
if (window.sidebar)
window.sidebar.addPanel(title, url, "");
And it worked.
Do you know how to fix this and have it working for FF as well?
And this is the link I use:
<a href="javascript:void(addBookmark())">Bookmark</a>
Thanks
javascript for bookmarking a site/page
-
- Guest
-
- Guest