我一直在调试器中得到这个错误。
You have included the Google Maps API multiple times on this page
我在WordPress中找不到纠正它的地方。最大的问题是。我使用的外观->编辑器->找不到哪里的API。
我想这就是阻止我的地图装载的原因。所有插件都是最新的。
url是:
谢谢你的帮助。
发布于 2016-04-26 06:49:30
很难看出这个问题,因为由于其他一些javascript错误,我不能忽略弹出的“您必须超过21岁才能进入这个站点”。如果你看不清我说的内容的话,你可能值得清除你的缓存(或者在私人浏览模式下访问页面)。
但是,查看页面源,您可以看到以下内容
<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?language=en&ver=4.4.37'></script>在上面,还有这个:
<script type="text/javascript">
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?v=3.23&language=en_US&libraries=weather,places' type='text/javascript'%3E%3C/script%3E"));
</script>它们都加载相同的代码。看看这一行:
<link rel='stylesheet' id='wpgmaps-style-pro-css' href='http://cutlersartisan.com/wp-content/plugins/wp-google-maps-pro/css/wpgmza_style_pro.css?ver=4.5' type='text/css' media='all' />让我觉得其中一个(我不确定哪一个)来自一个名为wp-google-maps-pro的插件。
在document.write()中添加的那个看起来已经改变了,因为我今天早上看了它(我很确定它没有places参数),所以您可能知道它的来源。
无论哪种方法,找到这两个位置的最简单的方法都是搜索所有的源代码(我假设您的编辑器可以对所有的maps.google.com/maps/api/js文件进行递归搜索),然后从那里开始。
https://stackoverflow.com/questions/36851985
复制相似问题