If I had a HTML page that was completely clean, how can I with Javascript be able to click on a button located in the body of the page that dynamically adds a div and the appropriate .js scripts to include in order to show a basic workin openlayers map? Any sample would be appreciated. Its easy for me to click on a button to dynamic add a div with id “map”, but I am not sure how to get dynamically include the .js script to have it be applied to the div tag.
Share
Create and place a
<div>when user clicks a button:Easiest way to dyanmically load a DIV on button click?
Dynamically load JavaScript source:
Ways to add javascript files dynamically in a page