Menu

Page Bookmark facility

Hello Friend,

Here we have describe sample demo for “Page Bookmark” facility.

JavaScript Function.


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

 function AddToFavorites(obj, title, url) {
 if (window.sidebar) {
 // Mozilla Firefox Bookmark
 window.sidebar.addPanel(title, url, "");

} else if (window.external) {
 // IE Favorite
 window.external.AddFavorite(url, title);

} else if (window.opera &amp;&amp; window.print) {
 //Opera Hotlist
 obj.setAttribute('href', url);
 obj.setAttribute('title', title);
 obj.setAttribute('rel', 'sidebar');
 obj.click();
 return false;
 }
 else {
 alert('Ctrl + D');
 }
 }

</script>

Here call event.

<a href="#" onclick="AddToFavorites(this, 'Testing', 'http://www.google.com');">Bookmark
 This Page</a>

No comments

Leave a Reply


− 7 = 0

Categories