Aude wrote:
I would like to test if a user has JavaScript enabled,
which can be done
with an Ajax call or other way. If they don't, then don't load all the
external JavaScript, so as to keep the code lightweight and fast. If
the user does have JavaScript enabled, then load the map.js script.
Depending on the mode selected, the OSM portion of the js can be loaded,
or the WorldWind portion, or other portion.
Just add it as <script src="whatever/map.js"></script>
If they don't have javascript enabled, they won't load it.
You can load the secondary ones from map.js by using importScriptURI()
or simply add more <script src="">, as the cost is negligible, just one
line.