HTML中的跨域问题 [英] Cross domain issue in HTML
本文介绍了HTML中的跨域问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用ajax inn html从其他域使用网络服务。当我使用它时返回错误,如Cross-Origin Request Blocked:同源策略禁止读取xxxxxxxxx处的远程资源(原因:CORS预检频道未成功)。我正在使用带有xml请求的soap web服务。
我尝试了什么:
阻止跨源请求:同源策略禁止读取xxxxxxxxx处的远程资源(原因:CORS预检频道未成功)
I'm consuming a web service from other domain using ajax inn html. when i consume it returns the error like "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxxxxxxxx (Reason: CORS preflight channel did not succeed)". I'm using soap web service with xml request.
What I have tried:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxxxxxxxx (Reason: CORS preflight channel did not succeed)
推荐答案
您需要使用JsonP绕过跨域相关问题。看看这里
javascript - 用jQuery创建跨域的ajax JSONP请求 - Stack Overflow
You need to use JsonP to bypass cross domain related issue. Take a look here
javascript - Make cross-domain ajax JSONP request with jQuery - Stack Overflow
这篇关于HTML中的跨域问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文