Faraz Shah Khan

MCP, MCAD.Net, MCSD.Net, MCTS-Win, MCTS-Web, MCPD-Web

Javascript to add bookmark option on your website

If you want to add an option that users can click a button on your website and it will open up bookmark option. Following is the code that will perform this task.

<html>
<body>
<SCRIPT LANGUAGE="JavaScript">
function bookmark(url, description)
{
if (navigator.appName=='Microsoft Internet Explorer')
{
window.external.AddFavorite(url, description);
}
else
{
alert('This option works with IE only as of now.');
}
}

</SCRIPT>
<input type="Button" ID="btnBookMark" onClick="bookmark('http://mypage.aspx','MyWebsite')" value="Bookmark" />
</body>
</html>

Comments

Scott said:

Works great!

# December 22, 2008 3:03 PM

parth said:

really good,thanks

# September 22, 2009 6:15 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)