Javascript 传单问题

Javascript 传单问题,javascript,leaflet,Javascript,Leaflet,我从JS的网站上复制代码 var-map=L.map('map').setView([51.505,-0.09],13); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'{ 属性:“©;贡献者” }).addTo(地图); L.标记([51.5,-0.09])。添加到(地图) .bindPopup('一个漂亮的CSS3弹出窗口。易于定制。') .openPopup()嗯,这看起来像:var calcula

我从JS的网站上复制代码

var-map=L.map('map').setView([51.505,-0.09],13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'{
属性:“©;贡献者”
}).addTo(地图);
L.标记([51.5,-0.09])。添加到(地图)
.bindPopup('一个漂亮的CSS3弹出窗口。
易于定制。')
.openPopup()嗯,这看起来像:var calcular=document.getElementById('calcular');id“calcular”不在index.html中。当我在index.html中输入时会出错,当我转到具有id的html时,该错误不存在。使用index.html中的映射在所有html中生成错误。另外,对于我的英语,我很抱歉。嗯,这看起来像:var calcular=document.getElementById('calcular');id“calcular”不在index.html中。当我在index.html中输入时会出错,当我转到具有id的html时,该错误不存在。使用index.html中的映射在所有html中生成错误。另外,我的英语很抱歉。