Feedback Form

Saturday, March 22, 2008

Add to bookmarks

Javascript simple code to add the current url to bookmarks (FireFox), or Favorites (IE).

function addToBookMarks()
{
if(document.all) //IE
window.external.AddFavorite(location.href,document.title);
else if(window.sidebar)window.sidebar.addPanel //FireFox
(document.title,location.href,'');
}

kick it on DotNetKicks.com

3 comments:

Anonymous said...

Hi Amr.
Your script is not working in Firefox neithe in IE, in IE its displaying pemission denied error. please tellme what's this,
Thanks.

Amr said...

seams that you have a problem in your browser security and not allowing javascript code to run as supposed to be.
By the way i used this code in a website i developed:
http://designer-handbag-store.com/


Tell me if thats not working with you too.

Amr said...

look at this as well:
http://wiki.asp.net/page.aspx/370/javascript-to-add-bookmark-option-on-your-website/