I am looking at using Jquery mobile and Phonegap to create a mobile app. If I know the structure of my app beforehand I can do this. However, I want to be able to have the ability for the app to connect to a server and add/remove pages based on the configuration for the app stored on the server.
Once the app has reconfigured itself it should work completely offline.
Is there some way to manage this in Javascript land or do I need to manage the reconfiguration with native code?
Regarding your questions there is 2 parts:
You can detect which connect the mobile is using, meaning that is it doesn't have one the mobile is offline. You can accomplish that with API of phonegap. You just need to check the following value:
navigator.network.connection.type
To have more information about it; you can check the documentation here that have a nice example:
http://docs.phonegap.com/en/1.0.0/phonegap_connection_connection.md.html#Connection
Also, regarding the request itself, as I don't know if you figured out how to do it, I have found another answer on stackoverflow that can help you :
Ajax requests to remote server on phonegap / local jquery or sencha
Regarding that part, Phonegap can use SQL lite to store data. So in you case, you juste need to store your data inside it to be able, later on, to use it offline.
You can find more information about it here:
http://docs.phonegap.com/en/1.0.0/phonegap_storage_storage.md.html
I really advise you to read the API reference of phonegap. It could give you more help on what you can do by default and I think it will make your life easier ;-)