<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><scripttype="text/javascript">
function initialize() {
var mapDiv = document.getElementById('map');
var myOptions = {
zoom: 12,
center: new google.maps.LatLng(41.850033, -87.6500523),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(mapDiv, myOptions);
addDropDown(map);
}
function addDropDown(map) {
var dropdown = document.getElementById('dropdown-holder');
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(dropdown);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<script src="bundle.js">
var stringAtual = "";
function insereMarca(){
stringAtual = stringAtual + ":" + value;
var funcoes = require('./funcoes')(value);
alert(funcoes);
}
</script>
The first two are used for the Maps API and the last one is to call Node.js (bundle.js is the Browserify to use require). In HTML I call "insertMar" with a basic onClick
<div class="dropdown-item" id="dropd" onclick='insereMarca()'>CLICK ME</div>
But this does not work, I wonder why, since the Google API is still working, does the HTML accept only a script in the head or something?
Thank you very much:)
ps. if I join the two scripts the API stops working
ps2. when I click on the dropdown the browser console shows "ReferenceError: insertMar is not defined"