Sarfraz Ahmed Sarfraz Ahmed - 4 months ago 36
CSS Question

How to add JS and CSS file in web page based on parameter?

I have a static html page which provides map based on selection from google map and openstreet map. I added Javascript and CSS file of both maps in the head tag. The problem is that if I only use Google map, the Javascript and CSS files for openstreet map are also loaded. How can I load Javascript and CSS file based on the map selection?


You can load css and js Files with JavaScript after user has selected the map provider
How to load up CSS files using Javascript?
How to include a JavaScript file in another JavaScript file?