Phonegap Build .ajax请求返回404(Phonegap Build .ajax request returning 404)

编程入门 行业动态 更新时间:2024-10-18 16:48:47
Phonegap Build .ajax请求返回404(Phonegap Build .ajax request returning 404)

我正在开发一个使用Adobe Phonegap Build服务构建的Phonegap应用程序。

它目前使用Phonegap 3.7.0。

通过jQuery .ajax方法发出的所有请求都返回404.当我通过Web浏览器提交相同的请求时,它成功完成。

我已经看到有关Cordova 5的帖子( Phonegap Cordova Ajax请求404(未找到)错误 )需要使用cordova-plugin-whitelist插件。

但是我是Phonegap的新手,所以我有以下问题:

Phonegap版本与Cordova版本有何关系? 这会受到使用Phonegap Build的影响吗? 有望在Phonegap Build网站上提供cordova-plugin-whitelist。 如果在Phonegap Build网站上没有插件,是否有其他方法可以使用插件?

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:

How does the Phonegap version relate to the Cordova version? Is this affected by using Phonegap Build? 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?

最满意答案

我通过更改config.xml中的访问令牌来修复此问题:

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

...至...

<access origin="*"/>

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

From

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

...to...

<access origin="*"/>

更多推荐

Phonegap,Cordova,Build,使用,电脑培训,计算机培训,IT培训"/> <meta name="des

本文发布于:2023-08-07 11:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464515.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ajax   Build   Phonegap   returning   request

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!