Sarfraz Ahmed Sarfraz Ahmed - 1 year ago 74
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?

Answer Source

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?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download