Im trying to make a cross domain request to a web service via jquery using $.getJSON() and it works fine! However, when I try to make the same request in Internet Explorer 7 or 8 the request is never sent. Anyone have any ideas?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
JSONP is here for this purpose. Check the JSONP section in getJSON jQuery documentation.
回答2:
IE explicitly blocks cross domain requests. Better to use a cross domain proxy on your server for better results!
Some documentation: http://ajaxpatterns.org/Cross-Domain_Proxy