Support Forums
"Add to Favourites" and "Set as Homepage" - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36)
+---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43)
+---- Thread: "Add to Favourites" and "Set as Homepage" (/showthread.php?tid=3765)



"Add to Favourites" and "Set as Homepage" - geeK - 12-19-2009

I sure that you have seen on a lot sites link "Add site to Favourites" and "Set this page as homepage", now I write simple tutorial how to put those link and on your site.

1. "Add to Favourites"
Code below add between <head> </head> tags on your site:
Code:
<script type="text/javascript">
function ie-ns-ff-bookmark(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
</script>

And this one on location where you want to be shown your link:
Code:
<a href="javascript:ie-ns-ff-bookmark('Support Forums', 'http://www.supportforums.net')">Add to Favourites!</a>

2. "Set as Homepage"
Code:
<script language="JavaScript">
function setHome()
{
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage(window.location.href);
}
</script>

And on location where you want to be "Set as Homepage" link, add this code:
Code:
<a href="javascript:setHome()">
Set as Homepage!</a>

Blackhat


RE: "Add to Favourites" and "Set as Homepage" - Grizzly - 12-19-2009

There are a lot of people that may not know that, good share man.