"The problem, as far as I can
tell, stems from what appears to be an early execution of the
document.ready function - in this case before an external stylesheet
has been loaded"

document.ready fires when the DOM is loaded, it doesn't wait for
external things to load, that's the whole point! :-)




"If so, is there a call I can use instead of document.ready to trigger
the code once the CSS has loaded?"

$(window).load(function() {
     // your code to run after the whole page, external things and
all, have loaded
});










On Jun 21, 5:17 am, "David Webster" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm having a few issues using jQuery in Firefox 3 and was wondering if
> anyone else has had similar problems. The problem, as far as I can
> tell, stems from what appears to be an early execution of the
> document.ready function - in this case before an external stylesheet
> has been loaded - making width(), height() and any css() method
> unpredictable.
>
> I've put together a test case here:http://dev.cognite.net/sandbox/jquery.html
> That's basically a wrapper that contains two iframes, both with
> exactly the same code, one with an embedded css and one with external
> css. The results I'm getting are that the two iframes report different
> values for the height, width and colour of elements, but only under
> Firefox 3. This is an intermittent problem - sometimes it doesn't show
> up, but most of the time it does, on both Mac and PC.
>
> Is this the correct behaviour? If so, is there a call I can use
> instead of document.ready to trigger the code once the CSS has loaded?
>
> If this is a bug, has it been reported already and is there a known
> work around - my googling hasn't thrown up anything on this topic.
>
> Thanks,
> David.
> --
> Kayak Travel:http://www.travellingkayak.com

Reply via email to