简体   繁体   English

Internet Explorer 9中的ajax CORS

[英]ajax CORS with Internet Explorer 9

I want to do cross domain ajax calls with custom header and cookies . 我想使用自定义标头和cookie进行跨域ajax调用。 I did it with CORS which works with Chrome, Firefox and IE 10 and 11. 我是使用可与Chrome,Firefox和IE 10和11配合使用的CORS做到的。

How can I get it to work in IE 9? 如何在IE 9中使用它?

Note: I need custom headers and cookies. 注意: 我需要自定义标题和cookie。

If your request are just GET and POST, you can use the XDomainRequest: http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx 如果您的请求只是GET和POST,则可以使用XDomainRequest: http : //blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx

There is a plugin for jQuery $.ajax: https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest 有一个jQuery $ .ajax插件: https : //github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest

If you want to use the full CORS capabilities (es: call REST services with a backbone.js fronted, use PUT and DELETE methods) sadly you cannot support IE 9. 如果您想使用完整的CORS功能(例如:使用frontember.js开头调用REST服务,使用PUT和DELETE方法),那么您将不支持IE 9。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM