ReferenceError:google没有定义 [英] ReferenceError: google is not defined
问题描述
我在我的网站中使用Google地图的API来显示几个位置。 Google地图在我的本地解决方案中工作得很好,但在我的网站中却没有问题。我更改了此来源
I use google map's api in my website to show couple of locations. Google Maps is working just fine in my local solution but not in my website. I changed this source
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.5&sensor=false"> </script>
到这个。并且我再次改变了这个
to this one. and i again changed this
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script>
带着这个...
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"> </script>
唯一说明的是: ReferenceError:google未定义
有谁知道这样的问题?
Does anyone familiar with such problem?
推荐答案
网站使用 https 进行连接,因此我无法使用 http://maps.google.com/maps/api/js?sensor=false 。当我调试整个页面时,该链接显示:警告:页面index.html运行不安全的内容。所以我又对谷歌进行了另一次搜索,并发现了这个问题。所以基本上导致问题的是在源代码部分中不使用https链接,所以正确的链接将是(对我而言)
Owing to the fact that my website uses https for the connection, I can not use http://maps.google.com/maps/api/js?sensor=false. When I debug the whole page, this link says: Warning : The page index.html ran insecure content. so I made another search on google and came across to this question. so what basically causes a problem is not using https link in the source part so the correct link will be (for me)
https://maps.google.com/maps/api/js?sensor=false
now everythnig works很好!
now everythnig works just fine!
这篇关于ReferenceError:google没有定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!