问题
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?
回答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