Pregunta

Why is $.support.cors false in IE 11? I'm using jquery 1.9.1 ($.fn.jquery == '1.9.1').

IE 11 should support cors.

$.support.cors is true in Chrome with the same version of jquery.

¿Fue útil?

Solución

$.support.cors does return true in IE 11, as demonstrated by this fiddle:

http://jsfiddle.net/dM8pk/

X-UA-Compatible set to IE=9 disables cors support.

The following will output "true" in IE 11

<!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>

But with <meta http-equiv="X-UA-Compatible" content="IE=9"> will output "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>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top