PDA

View Full Version : add to favorites


GavinBurns
02-28-2010, 06:04 PM
Evening all
Does anybody know how I can add a button to my site so when somebody clicks the button they can add my site to there favorites. Without going to favorites on the browser.
Thanks

tux
02-28-2010, 09:14 PM
This will work in IE but not in other browsers. Not sure you can with others.

<a href="javascript:window.external.addFavorite('http://localhost/PaulTuckerPhotography/leaf.html','Website Title');">

Why would you want to do this as IMO if the user wished to Bookmark you they would do. Clicking a link in your page is no different than clicking the link at the top of the browser. A bookmark link is IMO a waste of the valuable space on your page.

edbr
03-01-2010, 01:38 AM
this will do the same but add an alert for other browsers



<script type="text/javascript">
<!--
function addbookmark()
{
bookmarkurl="http://www.your site .com"
bookmarktitle="Put your title here"
if (navigator.appName == "Microsoft Internet Explorer")
window.external.AddFavorite(bookmarkurl,bookmarkti tle)

else {
alert("Browser does not allow this, Press CTRL-D or CTRL-T (Opera) to bookmark");
}
}



and call it by<a href="javascript:addbookmark()">Bookmark us</a>

Corrosive
03-01-2010, 06:45 AM
Or you can try http://addthis.com/ and offer some other ways of bookmarking as well :)

edbr
03-01-2010, 07:56 AM
yes actually i think it depends on the visitors addthis is obvious to us but to all im not sure all get it to be honest,

Corrosive
03-01-2010, 01:33 PM
yes actually i think it depends on the visitors addthis is obvious to us but to all im not sure all get it to be honest,

Aye, that is true.