How to add to Favorites/Bookmark in all browser in javascript
I have some query in Add to favorites/Bookmarked web page using java
script.I just go through in this Link and get this source code. It's been
working perfectly for the last month. Yet now it will not work in any
browser. Here is my code :
function CreateBookmarkLink(){
var title = document.title;
var url = document.location.href;
if(window.sidebar){
/* Mozilla Firefox Bookmark */
window.sidebar.addPanel(title, url, "");
}else if(window.external){
/* IE Favorite */
window.external.AddFavorite(url, title);
}else if(window.opera && window.print) {
/* Opera Hotlist */
alert("Press Control + D to bookmark");
return true;
}else{
/* Other */
alert("Press Control + D to bookmark");
}
<a href="javascript:CreateBookmarkLink();">Add to Favorites/Bookmark</a>
It doesn't work in any browser any more and just displays:
TypeError: window.sidebar.addPanel is not a function
> window.sidebar.addPanel(title, url, "");
Any ideas how to solve it? I also need to add favorites in chrome browser.
Any other idea to create bookmark for my website.
No comments:
Post a Comment