Thursday 15 November 2012

Creating Bookmark Using Javascript


Creating Bookmark Using Javascript


Use the following Javascript code to bookmark your page:


<script language="javascript" type="text/javascript">

function addBookmark() {

bookmarkurl = document.URL;

bookmarktitle = document.title;

if (document.all)  //Check the condition for IE

window.external.AddFavorite(bookmarkurl, bookmarktitle)

else if (window.sidebar) // Check the condition for Mozilla

{

window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");

}

}

</script>


In the body part :


<a href="javascript:addBookmark();">Bookmark this page!</a>

No comments:

Post a Comment

Thank You for Your Comments. We will get back to you soon.

back to top