Javascript 函数名上的google maps回调错误
当我运行html页面代码时,在webdev控制台中出现此错误Javascript 函数名上的google maps回调错误,javascript,google-maps,google-maps-api-3,uncaught-exception,Javascript,Google Maps,Google Maps Api 3,Uncaught Exception,当我运行html页面代码时,在webdev控制台中出现此错误 nc {message: "initialize is not a function", name: "InvalidValueError", stack: "Error↵ at new nc (https://maps.googleapis.com/m… ##################&callback=initialize:137:68"} 我的代码基于googlemaps api示例,只更改了样式,没有更
nc {message: "initialize is not a function", name: "InvalidValueError", stack:
"Error↵ at new nc (https://maps.googleapis.com/m…
##################&callback=initialize:137:68"}
我的代码基于googlemaps api示例,只更改了样式,没有更改函数
函数名为initMap,不过我最近更改了它,看看它是否有什么不同
我的javascript url是初始化函数
我的测试站点url是我已经找到了错误所在,以及如何回答我自己的问题: 我已经确定,包含googlemaps函数的javascript文件不应该是异步的。这将导致函数与GoogleMapsAPI调用同时加载,而不是在调用之后加载 就我而言
<script async type="text/javascript" src="js/home.js"></script>
变得没有异步
<script type="text/javascript" src="js/home.js"></script>