How to make jQuery functions sequential -
i have following code:
$(document).ready(function() { loadstuff(someurl, someid); showstuff('foo'); });
showstuff() relies on content generated loadstuff() seems if showstuff() jumping gun before said content available. how can force them run sequentially?
update: yes, there ajax calls in loadstuff unfortunately they're jsonp can't called synchronously.
rewrite as:
$(document).ready(function() { loadstuff(someurl, someid, function() { showstuff('foo'); }); });
where third parameter of loadstuff callback call after content loaded
Comments
Post a Comment