Debt Consolidation - Rome hotels - Electric blanket - Debt Consolidation - Computer Jobs

PDA

View Full Version : Bookmark Code That Works Across Browsers (Mozilla and IE)?


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!

crath
May 12th 2008, 6:33 pm
remove this line and try it

"window.sidebar.addPanel(title, url, "");"

micksss
May 13th 2008, 9:19 am
Thanks for your idea but it does not work.

Anyone else :)

crath
May 13th 2008, 9:27 am
When i test the code in firefox, it does not make a sidebar window :S

micksss
May 17th 2008, 7:57 am
When I test the code without this line

"window.sidebar.addPanel(title, url, "");"

It doesn't do anything for me in FireFox. Maybe I'm missing something else here. I'll mess around with it some more. Thanks for you reply.

dcristo
Jan 28th 2009, 8:06 pm
Did you find a solution mate?

dudes
Feb 16th 2009, 1:21 pm
Hi,
Any one that fix this problem can you please post it here.

thanks in advance.

micksss
Feb 16th 2009, 1:29 pm
I haven't yet... Still does the sidebar thing...