开发者

PhoneGap + ajaxComplete works in all browsers but not on iOS when loaded from PhoneGap.

开发者 https://www.devze.com 2023-03-23 16:32 出处:网络
I have a PhoneGap application which relies quite heavily on the jQuery ajaxComplete function. This appears to be working in all browsers (including Safari on iOS), but is not working on iOS when load

I have a PhoneGap application which relies quite heavily on the jQuery ajaxComplete function.

This appears to be working in all browsers (including Safari on iOS), but is not working on iOS when loaded from PhoneGap.

It is as though the ajaxComplete handler is completely removed by PhoneGap when the page loads.

Does any one have an开发者_JAVA百科y experience with this?

Thanks in advanced,

Aaron


To allow AJAX in iOS applications, we must modify ExternalHosts

  • In XCode, open Resources/phonegap.plist
  • Click ExternalHosts, add your external host to the list

Ex: *.your-ajax-site.com

Note: just add hostname, NOT including protocol, NOT http://


Maybe you like this:

 $.ajaxSetup({
  beforeSend:function(){...},
  complete:function(){...},
  success:function(){...}
 });
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号