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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.