|

楼主 |
发表于 2018-10-30 14:09:27
|
显示全部楼层
嗯,就是异步的原因,我在
var ajaxTimeOut = $.ajax({
"global" : false, // 此处设为false,即可
"type" : "post",
"async" : true,
"data" : soap,
"dataType" : "text",
"url" : url,
"timeout" : 10000,// 响应时间
"success" : function(data) {
// alert("success");
// debugger;
// 解析返回值
if (typeof ActiveXObject != 'undefined' && typeof GetObject != 'undefined') {
var doc = new ActiveXObject('Microsoft.XMLDOM');
var aaa = doc.loadXML(data);
}
if (typeof DOMParser != 'undefined') {
var xml = (new DOMParser()).parseFromString(data, 'text/xml');
var jsonString = xml.documentElement.textContent;
// json解析结果
var jsonObj = new Function("return" + jsonString)();
var result = jsonObj.success;
if (result == "true") {
justep.Util.hint("取消订单成功", {
"type" : "warning",
// "delay" : 100,
"position" : "bottom",
});
}
}
},
"complete" : function() {
self.comp('orderData').refreshData();
self.comp('orderFoodsData').refreshData();
}
});
"complete" : function() {
self.comp('orderData').refreshData();
self.comp('orderFoodsData').refreshData();
}
里面写就可以了,保证异步跑完了再去执行,谢了,飞哥 |
|