If you make an ajax call using the option async:false and beforeSend for example to show a loader, it'l work with FF and Opera but not in IE and Chrome
use below:
1.
function firstStep(){
var def = new jQuery.Deferred();
var systime=new Date().getTime();
$.ajax({
type: "POST",
url: '${ctx}/cn/xxx.action?systime='+systime,
data: {depCityCode: cityCode,depCity: cityName},
success: function(optStatus){
//TODO ....
def.resolve();
}
});
return def;
}
2.******
$.when(firstStep()).then(function(){
//TODO ....
});
use below:
1.
function firstStep(){
var def = new jQuery.Deferred();
var systime=new Date().getTime();
$.ajax({
type: "POST",
url: '${ctx}/cn/xxx.action?systime='+systime,
data: {depCityCode: cityCode,depCity: cityName},
success: function(optStatus){
//TODO ....
def.resolve();
}
});
return def;
}
2.******
$.when(firstStep()).then(function(){
//TODO ....
});