Results 1 to 2 of 2

Thread: Index.html: Possible to add/load something in it while the app is running?

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Vote Rating

    Default 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:
    <script type="text/javascript" src=""></script>
    I implemented an Offline-Mode in my app that lets it also start when there is no WiFi/UMTS available.

    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,

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    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 work
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts