【发布时间】:2017-12-07 06:16:24
【问题描述】:
我在 phonegap 应用程序中使用 ajax。
它根本不起作用。
相当简单的语法
$.post(
"http://sns.hugyou.cn/index.php?m=Index&a=get_list", {
"page": page,
"pagesize": PAGESIZE
},
function(response, status) {
alert(Home);
},
"json");
这适用于我手机上的任何网络浏览器,但 phonegap 除外。
在网上搜索后发现问题与跨域ajax有关。
但是 index.html 是存储在本地的,这应该没有任何问题。
我还尝试删除 config.xml 中的 <access origin /> 行,但仍然没有成功。
这似乎是一个很常见的问题,但我仍然找不到解决方案。
【问题讨论】:
标签: javascript jquery ajax cordova