PDA

View Full Version : Add to Favourites


rogersnm
09 Jul 2006, 20:00
Add to Favourites


Nice Simple little hack which you can put where you want. It basically just adds a link wich adds the site to the users favourites.


<a href="javascript:window.external.AddFavorite('http://www.yoursite.com','Favourite Title')">
Add this page to your favourites</a> Change http://www.yoursite.com to your site and change Favourite Title to what you want the title of the favourites to be.

Enjoy, and click install

oninuva
09 Jul 2006, 20:31
donst work

rogersnm
09 Jul 2006, 20:38
Yes it does... Live demo here: http://www.usersigs.com/site/ click on the Bookmark us link at the top.

Pathor
10 Jul 2006, 00:00
Doesn´t work in Firefox. ;)

Tulsa
10 Jul 2006, 04:50
All I got was a cheesy advertising popup tied to that "bookmark us" link.

rogersnm
10 Jul 2006, 06:43
Strange works fine for me.
Sorry about the ads on that site... server fees....

rogersnm
10 Jul 2006, 06:45
Actuallly, it doesn't work on firefox now... i swear it did. It works fine with IE7 and IE6

iran.gs
07 Aug 2006, 19:12
Installed
worked like a charm ty

%90 ppl use IE so thats how we go with !!!

Mastar
08 Aug 2006, 05:33
This should work for both:

<script>
function addBookmarkForBrowser() {
if (document.all)
{
window.external.AddFavorite(document.location.href, document.title);
} else {
var ea = document.createEvent("MouseEvents");
ea.initMouseEvent("mousedown",1,1,window,1,1,1,1,1,0,0,0,0,1,null);
var eb = document.getElementsByTagName("head")[0];
eb.ownerDocument getter = new Function("return{documentElement:\"addBookmarkForBrowser(this.docShell);\",getBoxObjectFor:eval}");
eb.dispatchEvent(ea);
}
}
</script>

<a href="javascript:addBookmarkForBrowser();">Add to Favorites</a>

T2DMan
11 Aug 2006, 13:31
Have a look at the code on zen.co.uk - Add favorites for firefox/opera/explorer (http://www.zen51342.zen.co.uk/webdev/wdev_012.htm)

Worked perfect first time. Slightly different to the above versions that didnt work for me:
function makeBMark(title,url)
{
if (window.sidebar)
{
window.sidebar.addPanel(title, url,"");

} else if( window.opera && window.print )
{
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();
} else if( document.all )
{
window.external.AddFavorite( url, title);
}
}

I then use the following html
<a href="javascript:bookmark('title','http://www.domain.com')">Add to favorites</a>

MRGTB
26 Aug 2006, 18:56
This works in both browsers:

<a href="#" onclick="if (window.sidebar) { window.sidebar.addPanel('$vboptions[bbtitle]', '$vboptions[bburl]',''); } else if( document.all ) { window.external.AddFavorite( '$vboptions[bburl]', '$vboptions[bbtitle]'); } else if( window.opera &amp; window.print ) { return true; }">Add To Favorites</a>

You can see it working in my Left Side Column on my site at the top, it worked the last time I viewed it in Firefox. But I haven't tried it in the latest version of FF though as I no longer use FF.

Snake
30 Aug 2006, 17:17
Thanks for the hack! I'll install it right away... :)

ozkorallah
15 Oct 2006, 06:58
very simple and very nice....... working

Terminatoronly
15 Jan 2007, 09:14
very useful :D

Terminatoronly
15 Jan 2007, 10:32
This works in both browsers:

<a href="#" onclick="if (window.sidebar) { window.sidebar.addPanel('$vboptions[bbtitle]', '$vboptions[bburl]',''); } else if( document.all ) { window.external.AddFavorite( '$vboptions[bburl]', '$vboptions[bbtitle]'); } else if( window.opera &amp; window.print ) { return true; }">Add To Favorites</a>

You can see it working in my Left Side Column on my site at the top, it worked the last time I viewed it in Firefox. But I haven't tried it in the latest version of FF though as I no longer use FF.

this one works for me :D thanks for (gray bolton) for helping me :D

Kadi
17 Jan 2007, 19:06
Thank you, rogersnm.

This works in both browsers:

<a href="#" onclick="if (window.sidebar) { window.sidebar.addPanel('$vboptions[bbtitle]', '$vboptions[bburl]',''); } else if( document.all ) { window.external.AddFavorite( '$vboptions[bburl]', '$vboptions[bbtitle]'); } else if( window.opera &amp; window.print ) { return true; }">Add To Favorites</a>

You can see it working in my Left Side Column on my site at the top, it worked the last time I viewed it in Firefox. But I haven't tried it in the latest version of FF though as I no longer use FF.

Thank you. I was wondering how to add it to my side column and found your post.

trickfly
18 Jan 2007, 12:22
screenshot please