Is there a simple way to create a link that does either?
Basically, I would like a very simple way to do this. Any suggestions are helpful.
UPDATE: Thanks for the responses! Does anyone know how to make a page their homepage using javascript?
Is there a simple way to create a link that does either?
Basically, I would like a very simple way to do this. Any suggestions are helpful.
UPDATE: Thanks for the responses! Does anyone know how to make a page their homepage using javascript?
In just IE:
<a href="javascript:window.external.AddFavorite('http://mysite.com', 'My Site')">Bookmark This Site</a>
In firefox and IE:
function addBookmark(title, url) {
if (window.sidebar) { // firefox
window.sidebar.addPanel(title, url,"");
} else if( document.all ) { //MSIE
window.external.AddFavorite( url, title);
} else {
alert("Sorry, your browser doesn't support this");
}
}
<a href="javascript:addBookmark('My Site','http://www.mysite.com')>Add bookmark</a>
There are ways to add favorites using Javascript, although some browsers don't support it at all. You can find a script here that claims to offer a cross-browser method of adding a bookmark, but actually just tells the user what to press to open the Add Bookmark dialog on Firefox, for example.
In all cases, all that javascript can do is open the add bookmark dialog, and the user will still have to manually add the bookmark themselves.