PhoneGap的构建阿贾克斯请求后返回404 [英] Phonegap Build .ajax request returning 404

查看:207
本文介绍了PhoneGap的构建阿贾克斯请求后返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在其上使用Adobe的PhoneGap构建服务建立了PhoneGap的应用程序。

目前,它使用的PhoneGap 3.7.0。

通过jQuery阿贾克斯方法的所有请求都返回404。当我通过它成功地完成网络浏览器提交相同的要求。

我见过的职位(<一个href=\"http://stackoverflow.com/questions/30048453/phonegap-cordova-ajax-requests-404-not-found-error?lq=1\">Phonegap科尔多瓦Ajax请求404(未找到)错误)约5科尔多瓦需要使用科尔多瓦 - 插件白名单插件。

不过,我是新来的PhoneGap,所以我有以下问题:


  1. 如何在PhoneGap的版本涉及到科尔多瓦的版本?

  2. 这是受使用的PhoneGap构建?

  3. 科尔多瓦-插件白名单似乎没有可用的PhoneGap的建立网站。有没有使用插件的另一种方式,如果在PhoneGap的网站建设不能访问它?


解决方案

我通过在config.xml改变访问令牌固定的:

 &LT;获得原产=HTTP://www.example.com*/&GT;

...到...

 &LT;获得原产=*/&GT;

I'm working on a Phonegap app which is built using the Adobe Phonegap Build service.

It currently uses Phonegap 3.7.0.

All requests made via jQuery .ajax method are returning a 404. When I submit the same request via a web browser it completes successfully.

I've seen the post (Phonegap Cordova Ajax requests 404 (Not Found) Error) about Cordova 5 requiring the use of the cordova-plugin-whitelist plugin.

However I'm new to Phonegap so I have the following questions:

  1. How does the Phonegap version relate to the Cordova version?
  2. Is this affected by using Phonegap Build?
  3. The cordova-plugin-whitelist does not seem to be available on the Phonegap Build website. Is there an alternative way to use a plugin if it is not available on the Phonegap Build website?

解决方案

I fixed this by changing the access token in the config.xml:

From

<access origin="http://www.example.com*" />

...to...

<access origin="*"/>

这篇关于PhoneGap的构建阿贾克斯请求后返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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