Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从 iOS 本地文件系统将 html 加载到 UIWebView 中。该 HTML 页面正在我们的服务器上请求 json 数据。
我可以获取 json 数据,所以问题是,UIWebView 中是否没有跨域策略,或者我在这里遗漏了什么?
它与桌面 Safari 相同:
如果您在 UIWebView 中加载本地(文件)url,则没有跨域限制
如果您正在加载外部 url,它们将被限制在该域中,除非该站点设置了正确的 Access-Control-Allow-Origin 标头。