20 Apr 2012 7:32 AM #1
Unanswered: Index.html: Possible to add/load something in it while the app is running?
I have the following problem:
I'm using Google Maps v3 in my app and so I have the following lines in my index.html:
But the problem is, when I start my app in the offline-mode, the google maps part in the index.html is not loaded of course. But when I activity my WiFi then and render my google maps view, I cannot use the map because Google Maps wasnt loaded in the index.html. I have to restart the whole app (with WiFi-activated) to be able to use the map.
So is there a way, to add/load code into the index.html? I would like to update the Google Maps Code in it, as soon as the Wifi/UMTS becomes activated again.
Thanks in advance,
23 Apr 2012 7:44 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
If online, you could add the <script> tag to the head element. On load of that <script> tag you can set a property on a namespace that says the google maps have been loaded. Then throughout your app you can check this property and if it is false or undefined then create the <script> element.
Disclaimer, this may or may not workMitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.