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(){...}
});
精彩评论