micksss
May 9th 2008, 11:26 am
I have searched everywhere and I can't find the correct code for users to create a bookmark that works in both Mozilla and Internet Explorer.
The closest thing I have found is below but it makes the bookmark open up in a side window in Mozilla Firefox. Does anyone out there know how to do this without the page opening up in the sidebar but the main window?
Thanks!
This code goes in the <head> section of the page.
<script type="text/javascript">
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
Then where ever you want the bookmark link to be use this code:
<a href="javascript:bookmarksite('title_of_site', 'url_of_site')">Bookmark Us</a>
There has to be someone out there who has figured this thing out :)
Thanks!
The closest thing I have found is below but it makes the bookmark open up in a side window in Mozilla Firefox. Does anyone out there know how to do this without the page opening up in the sidebar but the main window?
Thanks!
This code goes in the <head> section of the page.
<script type="text/javascript">
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
Then where ever you want the bookmark link to be use this code:
<a href="javascript:bookmarksite('title_of_site', 'url_of_site')">Bookmark Us</a>
There has to be someone out there who has figured this thing out :)
Thanks!