How can I stop executing function till another function is done?
$('#div').load( 'sub.html', function() {
//Do this once done loading the sub.html file
setTimeout(function() {
//Run SomeFunction(); before doing anyhing else
$('#tabsWrapper').removeClass('ajaxLoading');
$('#tabsWrapper #loaderDiv').fadeIn(500);
} , 1000);
});
I want to make sure SomeFunction()
is done before doing $('#tabsWrapper').removeClass('ajaxLoading');
etc..
Any suggestion how can I achieve that? Any help much appreciated.