Cross-domain requests using PhoneGap and jQuery doesn't work

前端 未结 5 738
夕颜
夕颜 2020-12-08 05:32

I\'m creating a PhoneGap app for Android. To get data from the (remote) server I make a REST call using jQuery\'s $.ajax() function. There are a few things you must know:

5条回答
  •  一整个雨季
    2020-12-08 05:52

    you need to whitelist your external domains. just go to your phonegap / cordova plist file in xcode and add a new entry, have it's value be * and you can access any website out there.

    also know that this WILL NOT WORK IN A BROWSER. Browsers have crossdomain issues, not phonegap or mobile devices.

提交回复
热议问题