简体   繁体   English

找不到Cordova和Ajax的休息服务

[英]Cordova and ajax not found rest service

Do you know why when you place the application on the mobile device and try to download JSON, jquery mobile (ajax) returns me the error 404, and if the same device in browser (chrome) json response is visible? 您是否知道为什么将应用程序放置在移动设备上并尝试下载JSON时,jQuery mobile(ajax)向我返回错误404,并且浏览器(chrome)json响应中是否存在相同的设备?

Does the application in Cordova can block access to the services of rest? Cordova中的应用程序是否可以阻止对其余服务的访问?

Cordova: 6.1.0 Android-cordova: 5.1.1 Device: Nexus Service: GET 科尔多瓦:6.1.0安卓-科尔多瓦:5.1.1设备:Nexus服务:GET

Because the whitelist blocks external calls on default 因为白名单默认会阻止外部呼叫

add this plugin, if is not added yet 添加此插件(如果尚未添加)

https://github.com/apache/cordova-plugin-whitelist https://github.com/apache/cordova-plugin-whitelist

And add this meta tag to your html 并将此元标记添加到您的html中

  <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM