Are pure and traditional Ajax Requests possible on native / hybrid mobile apps?

前端 未结 1 1661
情话喂你
情话喂你 2021-01-25 11:48

I know that using JSONP thechnique http://en.wikipedia.org/wiki/JSONP we can kinda make a cross domain Ajax Request.

But for this question that doesn\'t count as \"pure

1条回答
  •  离开以前
    2021-01-25 12:16

    PhoneGap apps run in webview not in browser, so cross origin is not an issue with PhoneGap apps, you can perform AJAX calls to any URL.

    The only thing to care of is that there is a white list parameter "access origin" in config used to restrict the access to some specific URLs.

    For older PhoneGap versions, the default setting for access origin was localhost, but now it is set by default to "*" which allows access to any URL.

    No need for JSONP or cors headers with PhoneGap.

    0 讨论(0)
提交回复
热议问题