Sorry for what appears to be a novice question, but this is on a website I am working on and am not very familiar with javascript. This function is supposed to allow me to bookmark a page, but it only works in IE and FF, not Chrome or Safari.
function bookmark_us(){
var titleElement = document.getElementsByTagName('title')[0]
if (window.sidebar) // firefox
window.sidebar.addPanel(document.title, window.location.href, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',window.location.href);
elem.setAttribute('title',document.title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(location.href, document.title);
}
And here is the image that calls the function:
<div class="bookmark">
<a href="javascript:bookmark_us();" onclick=""><img src="images/bookmark_button.png" alt="" /></a>
</div>
If I am missing any other pertinent code to help this get resolved let me know and I will post it right away. Thank you all in advance!