Need a workaround for cross domain ajax post in IE7

荒凉一梦 提交于 2019-12-10 17:33:32

问题


So IE7 does not support CORS (cross origin resource sharing). However, due to nature of my app, I have to make a cross domain ajax post. Is there some way to get this to work in IE7? Unfortunately, I cannot use a server side proxy for security reasons. Perhaps using an iFrame?

I forgot to mention, but I control the other server also.


回答1:


The Easy XDM library was developed to solve the cross origin problem :

easyXDM is a Javascript library that enables you as a developer to easily work around the limitation set in place by the Same Origin Policy, in turn making it easy to communicate and expose javascript API’s across domain boundaries.

I didn't use it yet, but we might have to try it to solve a Http / HTTPS Ajax call problem...

Hope that helps.

Other threads of interests :

  • Ajax using https on an http page
  • AJAX, Subdomains, and SSL



回答2:


Do it the old fashioned way: post the form to an iframe using the external domain. You can listen to the onload event on the iframe to know it has completed.

The other option is to use a server-side proxy and post it from there.



来源:https://stackoverflow.com/questions/10654955/need-a-workaround-for-cross-domain-ajax-post-in-ie7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!