-
20 Apr 2012 7:32 AM #1
Unanswered: Index.html: Possible to add/load something in it while the app is running?
Unanswered: Index.html: Possible to add/load something in it while the app is running?
Hello everyone,
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:
I implemented an Offline-Mode in my app that lets it also start when there is no WiFi/UMTS available.Code:<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
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,
Florian
-
23 Apr 2012 7:44 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
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 Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
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 services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote