PhoneGap的科尔多瓦AJAX请求404(未找到)错误 [英] Phonegap Cordova Ajax requests 404 (Not Found) Error

查看:166
本文介绍了PhoneGap的科尔多瓦AJAX请求404(未找到)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的科尔多瓦版本的 5.0.0

我得到一个404错误的所有Ajax请求时,应用程序部署在设备上进行。在Web浏览器,它的工作原理的设备无法正常工作部署时正常,但相同的应用程序。

I am getting a 404 error for the all ajax request made when the app is deployed on the device. On the web browser, it works fine but same app when deployed on a device does not work.

我尝试添加下面来解决这个问题,但它并没有帮助。

I tried adding following to solve the issue but it hasn't helped.

的Config.xml

<access origin="*" />

AndriodManiest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

我还添加了我的index.html文件以下,但它并没有任何区别两种。

I also added following in my index.html file but it didn't make any difference either.

<script>
    $.support.cors=true;
</script>

这里有人有另一种技巧来解决这个问题?似乎是一个相当普遍的问题,PhoneGap的,但上面的PhoneGap的/科尔多瓦而非他们的年龄较大的vesion工作的补丁在我的情况下工作过。

Anyone here has another trick to solve this issue?, Seems to be a quite common issue with phonegap but the fixes above worked in older vesion of the phonegap/cordova but non of them has worked in my case.

任何帮助将是巨大的。

推荐答案

我有同样的问题,必须安装科尔多瓦 - 插件白名单

I had the same issue and had to install the cordova-plugin-whitelist

cordova plugin add cordova-plugin-whitelist

幸得此计算器的文章 - <一个href="http://stackoverflow.com/questions/29757593/ajax-command-to-request-url-no-longer-working">Ajax命令不再请求URL工作

这篇关于PhoneGap的科尔多瓦AJAX请求404(未找到)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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