即使我在网络选项卡开发工具中获得了200状态代码,也没有调用成功函数。
var isServiceUp=false;
do{
var response=jQuery.ajax({
url : "https://127.0.0.1:18647/dcs/dcs_6200808/",
method : "POST",
//data : formData,
//cache : false,
//async : false,
success : function(data, textStatus, jqXHR){
//debugger;
console.log("hey i am up");
isServiceUp=true;
},
error : function(jqXHR, textStatus, errorThrown){
}
});
}while(!isServiceUp)
您将处于无限循环中,浏览器将崩溃,您将永远不会收到错误消息,成功等等!
请尝试没有do while
:
var response=jQuery.ajax({
url : "https://127.0.0.1:18647/dcs/dcs_6200808/",
method : "POST",
//data : formData,
//cache : false,
//async : false,
success : function(data, textStatus, jqXHR){
//debugger;
console.log("hey i am up");
isServiceUp=true;
},
error : function(jqXHR, textStatus, errorThrown){
}
});