Follow us

Saturday, March 5, 2011

Javascript to Bookmark a page / Add to Favorites


Page can be bookmark or add to Favorites using the following javascript:


<script language="javascript" type="text/javascript">
function Bookmark()
{
    var url = window.location;

    var title = document.title;
    if(title.length > 0)
    {
        title=title;
    }
    else
    {
        title='Technoscatter - Drive to Technology'; //Replace the title with Default Title
    }
  
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
    {
        window.external.AddFavorite(url, title);
    }
    else if (navigator.appName == "Netscape")
    {
        window.sidebar.addPanel(title, url, "");
    }
    else
    {
        alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
    }
}
</script>

Demo

Click the Button below

Download

You can also download the javascript from here.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "Javascript to Bookmark a page / Add to Favorites"

Post a Comment