Phonegap Build .ajax request returning 404

戏子无情 提交于 2019-12-11 15:56:42

问题


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?

回答1:


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

From

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

...to...

<access origin="*"/>


来源:https://stackoverflow.com/questions/30233919/phonegap-build-ajax-request-returning-404

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!