Forum Moderators: mack
I want a link on my site which bookmarks the site for broswers. I want to use the JS as external. Here is what i put in the head of the page:
<script type="text/javascript" language="javascript" src="/path/filename.js"></script>
And in the external JS file i have put:
<script LANGUAGE="Javascript">
var txt = "bookmark this site";
var url = "http://www.mydomain.com";
var who = "My Domain";
var ver = navigator.appName;
var num = parseInt(navigator.appVersion);
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
document.write('onMouseOver=" window.status=');
document.write("txt; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('">'+ txt + '</a>');
}else{
txt += " (Ctrl+D)";
document.write(txt);
}
</script>
The thing i'm not clear on is what do i put on the link, so it knows which link is to make this happen. I put /bookmark.js, and it worked but sent the broswer to a blank page where you click on the link.
Please can someone explain to a novice.
Thanks,
Tim
P.S. Also, doesn't seem to work for firefox, only IE.
Anyone know what code needs to go into the script to make it compatible with browsers other than IE?
Thanks,
Tim