i am trying to sync three functions which have AJAX calls in them.
main(){
compileTemplate();
}
compileTemplate(){
func1();
func2();
func3();
}
each func has structure like :
func(){
$.when($.get(url)).then(func(d)
{//do something});
Each func() is completing on its own. i need when func1 completes then func2 should start.
checked
$.when(func1()).then(func2());
but its not working. please do anyone has any idea.
.then(func2);FYI, chaining.then()has not expected behaviour in jq<1.8