ie ajax xhr get,javascript - IE10/11 Ajax XHR error - SCRIPT7002: XMLHttpRequest: Network Error 0x2e...

I've been working on this problem for a few days and reaching out on this forum since I feel like I've exhausted my options. I have a form hosted on a Drupal 7 website and need to submit the form values to an external url. The form uses a POST request over the HTTPS protocol via jQuery.AJAX

Form works fine in Chrome, Firefox, and Safari

I am receiving the following error in IE10+ console (and the ajax call always goes into the error function when using IE10+):

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

I've tried the following:

adding contentType:

// causes all of the jQuery callbacks to error out

"application/json; charset=utf-8",

attempting an Ajax GET call before the actual POST (as suggested on another SO thread)

added header( 'Content-Type: application/json; charset=utf-8' ); to the request

set crossDomain: true

The appropriate CORS headers have been added and the form code is pasted below:

$.ajax({

url: "[URL]", //the page to receive the form data

crossDomain: true,

type: "POST",

data: dataString, //posting to API

dataType: "json", //the data type the function should expect back from the server

success: function(data) {

if (data.response_status == "1") { //error for at least 1 field

//display error message

}

else {

//display thank you label next to input

}

} else {

//All form fields completed successfully! Redirect user to Thank you confirmation page

}

},

error: function(jqXHR, textStatus, errorThrown) {

alert("there is an error!");

console.log("in error section");

console.log("jqXHR: " + jqXHR);

console.log("jqXHR.responseText: " + jqXHR.responseText);

console.log("textStatus: " + textStatus);

console.log("errorThrown: " + errorThrown);

data = $.parseJSON(jqXHR.responseText);

console.log("parseJSON data: " + data);

}

});

});

});

Any guidance would be helpful! THANKS

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值