Phonegap apps are usually different from general web sites, even if they are written with the same language.
Main differences:
- a Phonegap app loads main pages from local file
- many web frameworks for mobiles (like jQuery Mobile) usually load a single html file and then programmatically change pages.
So I think it’s outdated the common suggestion of put code on external JS file. Is it true?
What’s the best way to organize the code so it will be fast to load and easily maintainable? (e.g. do you separate code that concerns the view and code that concerns the data?)
Even with jQueryMobile I have many html files. Sometimes we’re loading a portion of content from another html file using the jQueryMobile mechanism of loading just a particular #id from the html file. In many apps the data is being loaded from an external site and being inserted into the content from the local files. If I do load any data locally I use a data subfolder unless I’m loading from local storage.
Given that, here is my typical structure of my www folder: