jenswirf
jenswirf

Reputation: 7317

Injecting local HTML code into iPhone Phonegap webapp

I've got a bit of HTML code that I'd like inject into a main HTML-document only when needed. (Holding off this code at first will hopefully make the app load up faster) Since, it's phonegap-wrapped I guess the files run locally on the device and the solution must cope with that.

What's the best way of doing this? Will an XMLHttpRequest work locally in an iPhone Phonegap app? Which method is the fastest?

Optimally, I would like the method to have an event or a way to determine when the code has completely finished loading..

Upvotes: 1

Views: 397

Answers (1)

vrunoa
vrunoa

Reputation: 776

Remember to add your url to the Phonegap.plist to use cross-domain, on the field ExternalHosts just add an item with value "http://your_api_site" or directly "*".

Upvotes: 1

Related Questions