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

前端 未结 5 741
夕颜
夕颜 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:40

    Try setting dataType:jsonp and set crossDomain:true For cross domain ajax requests you can use jsonp. http://api.jquery.com/jQuery.ajax/

    Or you can append callback=? to your url.

提交回复
热议问题