174
rated 0 times
[
175]
[
1]
/ answers: 1 / hits: 31862
/ 11 Years ago, fri, april 12, 2013, 12:00:00
What is the best way to use the jQuery load function synchronously.
I need to load an image but can't execute the next line of code until that image has loaded.
I could loop a variable until the load has completed but was wondering if there was a better way of doing that.
var img = jQuery('<img src=' + url + '/>').load(function () {
});
//Run code here once img load has comlpeted.
More From » jquery