Friday, November 19, 2010

Java Script : How to bookmark through Javascript function

The below JS function bookmarks a link. All that you need to do is to invoke the javascript function when the user clicks on Bookmark button.

function bookmark()
{
    bookmarkurl="http://www.google.com"
    bookmarktitle="Google"
    if (document.all)
        window.external.AddFavorite(bookmarkurl,bookmarktitle)
    else if (window.sidebar) // firefox
        window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}

No comments:

Post a Comment