0

I have this function:

function correctBookmark() {
            var title = "SERCO Benefits";
            var url = "http://wwww.example.com";
            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");
            }
        }

If I use an onclick function in association with a button, it works in IE and FF.

If I use:

window.onload = function () { correctBookmark(); }

It works in FF but not IE.

If I use:

$(document).ready(function () {
            correctBookmark();
         });

It works in FF but not IE.

I want to auto bookmark for the user. Any suggestions?

Edited by Ezzaral: Changed URL to generic example.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by fxm
1

I want to auto bookmark for the user. Any suggestions?

Yes: don't do it.
And if you do, don't expect universal approval.
I can only hope that most users know enough to keep their toolbars and bookmarks locked.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.