Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法读取属性';地图';在使用HTML时使用jade和主干定义的未定义_Javascript_Node.js_Google Maps Api 3_Pug_Marionette - Fatal编程技术网

Javascript 无法读取属性';地图';在使用HTML时使用jade和主干定义的未定义

Javascript 无法读取属性';地图';在使用HTML时使用jade和主干定义的未定义,javascript,node.js,google-maps-api-3,pug,marionette,Javascript,Node.js,Google Maps Api 3,Pug,Marionette,我试过这个密码 <html> <head> <script src="http://maps.googleapis.com/maps/api/js"></script> <script> function initialize() { var mapProp = { center:new google.maps.LatLng(41.63, -1), zoom:5, mapTypeId:google.maps.MapTypeId.ROAD

我试过这个密码

<html>
<head>
<script src="http://maps.googleapis.com/maps/api/js"></script>
<script>
function initialize() {
var mapProp = {
center:new google.maps.LatLng(41.63, -1),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"), mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="googleMap" style="width:500px;height:380px;"></div>
 </body>
 </html>
在我的玉页上:

  #googleMap(style='width:500px;height:380px;')

该脚本与整个应用程序的所有初始化脚本一起添加到其他文件中,我无法更改架构,它不是我的

如果有人遇到同样的问题,下面是它对我的作用: 我在标题中添加了两个脚本: 脚本(src='/lib/googlemaps/lib/google.js') 脚本(src='') 并将变量映射替换为以下行: var map=new google.maps.map(this.$el[0],mapProp); 因为它应该读取元素。 但渲染仍然是一个问题

  #googleMap(style='width:500px;height:380px;')