Jquery Ajax不能与Phonegap一起使用 [英] Jquery Ajax is not working with Phonegap

查看:132
本文介绍了Jquery Ajax不能与Phonegap一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚接触Phonegap。我试图在我的移动应用程序中使用AJAX调用,当我调用url,我收到错误。没有结果是来自我从我使用的url。当我尝试在浏览器中的相同的URL,我得到的结果以json格式。

I'm new to Phonegap. I'm trying to use AJAX call in my mobile application, when i call the url, I'm getting error. No result is coming for me from the url which i'm using . when i try the same URL in browser i'm getting the result in json format.

我在Ajax请求标头中关闭连接时收到错误。

I'm getting the error as Connection closed in the Ajax request headers.

欢迎任何建议。

推荐答案

检查res / xml文件夹中的config.xml文件
并用以下代码替换访问来源



Check your config.xml file in res/xml folder and replace access origin with the following code

<access origin="*" />

还会检查minifest文件:

also check the minifest file if you have enabled the following permission:

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

这篇关于Jquery Ajax不能与Phonegap一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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