tags:

views:

496

answers:

3

I am using jQuery 1.3.1 and saying $('#somediv').load('somepage.aspx') An aspx that have a Repeater which loads few images. When loading is complete a cycle() function (jQuery plug-in) will be called upon them.

Now I have this working on http://www.techlipse.net/test/agb via the function called from the menu-event-handlers (a combo box). When it is loaded via the event handler of the combobox I call cycle() plugin as a callback function to the load() method, or function .. I think I might have misunderstood some of the fundemantals of javascript, or why the document.ready() is firing long before the images are fully loaded therefore failing the cycle() plug in. When it is said to be a bug of jQuery1.3.1 that it does wait for them to load. Posted here:

http://stackoverflow.com/questions/477463/jquery-is-waiting-for-images-to-load-before-executing-document-ready/1156171#1156171

any help .?

+2  A: 

document.ready fires once the document is ready. Not the images. You'll have to run a second check on images to check they have totally loaded.

Mike Robinson
+1  A: 

The whole point of $(document).ready is that it fires as soon as the DOM is manipulable, but before window.onload - which fires after all HTTP traffic is done with.

DDaviesBrackett
Thanks.. so other than images, are there anything else that are not included to the DOM structure?
external CSS may not have loaded either.
DDaviesBrackett
+1  A: 

You should upgrade from 1.3.1 ASAP. Its $(document).ready() functionality was buggy, making generally correct answers about $(document).ready() not necessarily accurate in your situation.

Dave Ward