为什么$.support.cors
false
在 IE 11 中?我正在使用 jquery 1.9.1 ( $.fn.jquery == '1.9.1'
)。
$.support.cors
在具有相同版本 jquery 的 Chrome 中是正确的。
为什么$.support.cors
false
在 IE 11 中?我正在使用 jquery 1.9.1 ( $.fn.jquery == '1.9.1'
)。
$.support.cors
在具有相同版本 jquery 的 Chrome 中是正确的。
$.support.cors
确实true
在 IE 11 中返回,正如这个小提琴所示:
X-UA-Compatible
设置为IE=9
禁用 cors 支持。
以下将在 IE 11 中输出“true”
<!DOCTYPE html>
<html>
<body>
</body>
<script src="https://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('<h1>').text($.support.cors).appendTo($('body'));
});
</script>
</html>
但是 with<meta http-equiv="X-UA-Compatible" content="IE=9">
会输出“false”
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9"></meta>
</head>
<body>
</body>
<script src="https://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('<h1>').text($.support.cors).appendTo($('body'));
});
</script>
</html>