Phonegap uses html source located in www folder. I was testing what happens if index.html is still in www, but it links to other html that are located in at the server side. It will open the server side html in the web browser instead of handle it as part of the app.
Is there any way to make phonegap work with server side html + js source?
It is not a bad idea if you need to mix usage of libraries (jars + ios libraries), local phonegap html+js with server side dynamic html code (like php output).
thanks.
Phonegap is designed to deploy a client, a web app inside a native web view. You can write a server side API for returning any information your app may need and you can modify the DOM using JS. There are great templating solutions out there such as mustache.js. The idea is to write the app fully in JS and retrieve information from the server using any of Ajax implementations in your favourite JS framework. You shouldn't need any dynamic JS. Just information to template and insert into the DOM.
I can't find any reasonable explanation anywhere, but the reason why you can't invoke PhoneGap API's when html is hosted on server-side is because cross-site-scripting issue as the webkit does not allow scripts coming from one domain (i.e. server) be executed on different domain (localhost-device)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With