Ajax请求"访问被拒绝"在IE浏览器被拒、浏览器、Ajax、QUOT

2023-09-10 16:51:57 作者:你的温柔已用尽丶

我以检查网站如下响应使用Ajax请求,

I use ajax request in order to check response of websites as follow,

$.ajax ({
    url: 'https://www.example.com',
    cache: false,
    success : function() {
        alert(new Date() - start)               
    }, 
}) 

它适用于所有浏览器本地PC。当我把它放在服务器上,它工作于Chrome和Firefox,但不是在IE8。

It works on my local pc in all browsers. When I put it on the server, it works in Chrome and Firefox but not in IE8.

我得到的错误:访问被拒绝jquery.min.js

为什么会出现这个错误?

Why am I getting this error?

推荐答案

对于我来说,这个问题是因为兼容模式的结果。我在内部网​​和Internet Explorer与兼容模式下运行。 我添加下面的标记,这解决了我所有的问题。它迫使IE浏览器不使用兼容模式。

For my case the problem is resulted because of compatibility mode. I am in intranet and internet explorer is running with compatibility mode. I added following tag and this solved all my problems. It forces IE to not use compatibility mode.

<meta http-equiv="X-UA-Compatible" content="IE=Edge" >
 
精彩推荐
图片推荐