0
我想添加地圖在事業部(動態創建的)的innerHTML的innerHTML的的.....我想添加地圖在事業部(動態創建的)
var ni = document.getElementById('content');
var newdiv = document.createElement('div');
newdiv.setAttribute('id',idname);
newdiv.innerHTML = map[i];//it is not adding map,because map[i] is not defined...how to solve this...
ni.appendChild(newdiv);
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map[i] = new google.maps.Map(document.getElementById(idname),myOptions);
i++;