I've had problems with .ready() in IE, too, but have found that adding a setTimeout() usually works as a workaround:

$(document).ready(function() {
   setTimeout(function() { // making IE happy (and sometimes Safari)
       doSomething();
   }, 500);
});

Sometimes the timeout length (500 above) can be set to a very short number, like 10 or 50, but I usually experiment with it a bit to get something that works consistently with the page.

FWIW, I have not used 1.2.x yet (too many plugins written for 1.x to test), so am not sure if this holds true (as an issue or a workaround) for 1.2.x.

- Jack

andy9989 wrote:
Hi All

A simple script starting from

        $j(document).ready(
        function(){
        ........
       })

Does not work in IE (FF and other browsers are OK). Placing it before
</body> makes everything working. It looks as  IE tries to execute the
script before building DOM tree, though (document).ready implies that
it should wait for DOM.

Am I missing something here? Plese, advise,

Thanks

A



Reply via email to