从设备到服务器的ajax [英] ajax from device to server

查看:61
本文介绍了从设备到服务器的ajax的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

一些安全问题.

我从Android设备到iis服务器使用$ ajax,并且出现了一些错误:

I use $ajax from android device to iis server and some error is coming :

安全错误:无法在"xmlhttprequest"上执行打开":由于其违反了文档的内容安全策略,因此拒绝连接到"http://xxx/yyy/ppp.svc/mmm".

security error : failed to execute 'open' on 'xmlhttprequest' : refused to connect to 'http://xxx/yyy/ppp.svc/mmm' brcause it violates the document's content security policy.

有了模拟器,它就可以正常工作.

With emulator it works, no problems.

请问任何想法.

非常感谢罗马人

推荐答案

modify <meta http-equiv="Content-Security-Policy" content="default-src" 'self' ...>
to
<meta http-equiv="Content-Security-Policy" content="default-src" 'self' http://xxx/ ...>

有关内容安全策略的更多详细信息,可以参考以下链接:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/index.html#content-security-policy

For more details about Content Security Policy, you can refer to following link:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/index.html#content-security-policy


这篇关于从设备到服务器的ajax的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆