我已将Cordova iOS应用升级到最新版本:
iOS 4.1.0Cordova 6.0.0
我已经更新了插件并添加了新的WKWebView 发动机 </跨度> 插入。
我添加了我的内容安全性 - 政策 </跨度> 到index.html文件:
&lt; meta http-equiv =“内容 - 安全 - 政策 </跨度> “content =”default-src’self’; script-src’self’‘unsafe-inline’‘unsafe-eval’; style-src’self’‘unsafe-inline’; img-src’自我锟
@jcesarmobile是对的。只需添加 httpProtocol 对我的 web.config 还不够。我还必须添加以下代码 global.asax Application_BeginRequest :
httpProtocol
web.config
global.asax Application_BeginRequest
HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*") If HttpContext.Current.Request.HttpMethod.Equals("OPTIONS") Then HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST, PUT, DELETE") HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept") HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000") HttpContext.Current.Response.End() End If