emre
emre

Reputation:

jQuery(document).ready() load() aspx

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:

JQuery is waiting for images to load before executing document.ready

any help .?

Upvotes: 0

Views: 1107

Answers (3)

Dave Ward
Dave Ward

Reputation: 60580

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.

Upvotes: 1

Dan Davies Brackett
Dan Davies Brackett

Reputation: 10071

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.

Upvotes: 1

Mike Robinson
Mike Robinson

Reputation: 25159

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.

Upvotes: 2

Related Questions