IE中的HTTPS Ajax请求问题(非交叉域)

我只是在IE中遇到一个HTTPS Ajax调用的问题。 IE似乎认为我正在提出跨域请求,但我不是。 从https://mydomain/customer_profile.php页面调用以下代码:

 $.ajax({ type: 'post', url: 'https://mydomain/ajax/retrieve_transaction_details.php', data: /* my data is here */, success: function(response){ // do something with the response }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); 

除IE之外,此请求在每个浏览器中都能正常运行。 在IE中,错误函数返回“错误:访问被拒绝”。 就像我说的那样,我对此完全感到困惑,所以任何见解或想法都会很棒。

我猜你在HTML的head部分使用了标签; 对?

如果它指向http而不是https ,那将破坏IE

尝试在您的请求中将crossDomain设置为true,如下所示:

 $.ajax({ type: 'post', url: 'https://mydomain/ajax/retrieve_transaction_details.php', data: /* my data is here */, crossDomain: true, success: function(response){ // do something with the response }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); 

这应该允许您发出请求,无论它是否是跨域的。