Add functionality of Bookmark in your site.

Neeks
Posted by Neeks under JavaScript category on | Views : 2177
JavaScript which will help to add the link in the Bookmark
<script language="javascript" type="text/javascript">
//Function to add the Link and the Title of the Link in the Bookmark List
function fnfav(url,title)
{
//url --> Site URL you want to add in the Bookmark List
//title --> Title you want to display with the Bookmark
switch(navigator.appName)
{
case "Microsoft Internet Explorer":
if((parseInt(navigator.appVersion) >= 4))
window.external.AddFavorite(url,title);
break;
case "Netscape":
window.sidebar.addPanel(title,url,"");
break;
default:
{
alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
}
}
}
</script>

For your ASPX page
<form id="form1" runat="server">
<div>
<b>Add functionality of Bookmark in your site.</b>
This example shows how we can add the functionality for adding the site in the Bookmark list.
<hr />
<a href="#" onclick="fnfav('http://www.google.com', 'Google');">Add to favourate</a>
</div>
</form>

Comments or Responses

Login to post response