Aaron
Aaron

Reputation: 21

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

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 any experience with this?

Thanks in advanced,

Aaron

Upvotes: 2

Views: 1107

Answers (2)

damphat
damphat

Reputation: 18956

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://

Upvotes: 5

Nick Nizovtsev
Nick Nizovtsev

Reputation: 373

Maybe you like this:

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

Upvotes: 0

Related Questions