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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -