阿贾克斯命令不再请求URL工作 [英] Ajax Command to request URL no longer working
问题描述
我刚刚更新了我的科尔多瓦版本。当我运行
I just updated my cordova version. When I run
cordova -v
它输出5.0.0版本
It outputs version 5.0.0
在科尔多瓦的我(其实我不记得是什么版本,这是)我可以使用AJAX来从给定的URL请求数据的旧版本。但是,更新的科尔多瓦版本之后,它不再起作用。我并没有修改这一更新后的code,所以我猜的东西在新的科尔多瓦版本是经过preventing请求。
On the older version of Cordova I had (I actually don't remember what version that was) I was able to use AJAX to request data from a given URL. However, after updating the Cordova version, it no longer works. I have made no edit to the code after this update, so I'm guessing something in the new Cordova version is preventing requests from going through.
我在config.xml文件中添加下列访问助学金:
I have added the following access grants in my config.xml file:
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
但仍没有运气。
but still no luck.
有没有人遇到过类似的问题?任何想法,我怎么能得到它的工作?
Has anyone come across a similar issue? Any idea how I can get it working again?
谢谢
推荐答案
原来我只是缺少以下插件:
Turns out I was just missing the following plugin:
科尔多瓦 - 插件白名单
cordova-plugin-whitelist
在我安装了它,RM android平台,重新添加了Android平台,构建和运行,它的工作!
After I installed it, rm the android platform, re-added the android platform, build and run, it worked!
这篇关于阿贾克斯命令不再请求URL工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!