我想动态加载谷歌地图,所以我只在需要时加载它们,但我不断收到错误 google is not defined here is my code
$(document).ready(function(){
if($('.geotags').length > 0){
$("head").append('<script type="text/javascript" src="http://www.google.com/jsapi?key=keytogooglemapsapi"></script>');
google.load("maps", "2.x", {"other_params":"sensor=false",'callback':build_gmaps});
}
}
编辑 添加更多代码以显示我想在哪里执行此操作