ie11是否支持ajax,javascript

I have some problem here. I use JQuery Ajax to send request to my back end server and it will return some clue to notice if the request successfully proceed or not.

I had try to do it in IE8 and IE7, the Jquery Ajax works well, but when i try it on IE11, it will be error for few times, and then work well after that.

My question is, how to make it run well on IE11 without have to wait few times?

This is my Jquery Ajax script

var value = $("#record"+index).attr('value');

var hiddenAmount = Number ($("#hiddenTotalAmount").val());

var values=value.split('/');

var uncheckedAmount = Number(values[1]);

var realAmount = 0;

var realRecord = Number ($("#totalRecord").val());

var checkedDoc = $("#record"+index).val();

var dataString = "action=validateDocNum&holdDocNum="+checkedDoc;

if($("#record"+index).attr('checked')){

$.ajax({

type: "POST",

url: "executeSp2d.do",

data: dataString+"&act=check",

cache: false,

success : function(msg) {

console.log(msg);

console.log(msg.result);

msg.result=$.trim(msg.result);

if(msg.result=="1"){

/* $("#uncheckRecord").dialog('close'); */

realAmount = hiddenAmount + uncheckedAmount;

realRecord = realRecord + 1;

$("#totalRecord").val(realRecord);

$("#hiddenTotalAmount").val(realAmount);

realAmount = accounting.formatMoney(realAmount, "", 2, ".", ",");

$("#totalAmount").val(realAmount);

}else{

alert('Fail to uncheck records');

$("#record"+index).attr('checked', false);

}

},

error: function() {

alert('Fail to check records');

$("#record"+index).attr('checked', false);

}

});

}else{

$.ajax({

type: "POST",

url: "executeSp2d.do",

data: dataString+"&act=uncheck",

cache: false,

success : function(msg){

console.log(msg);

console.log(msg.result);

msg.result=$.trim(msg.result);

if(msg.result=="1"){

realAmount = hiddenAmount - uncheckedAmount;

realRecord = realRecord - 1;

$("#totalRecord").val(realRecord);

$("#hiddenTotalAmount").val(realAmount);

realAmount = accounting.formatMoney(realAmount, "", 2, ".", ",");

$("#totalAmount").val(realAmount);

}else{

alert('Fail to uncheck records');

$("#record"+index).attr('checked', true);

}

},

error: function() {

alert('Fail to uncheck records');

$("#record"+index).attr('checked', true);

}

});

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值