“google is not defined” when using Google Maps V3 in Firefox remotely

前端 未结 14 2170
太阳男子
太阳男子 2020-12-01 10:28

Here\'s my conundrum: I have a page that uses Google Maps V3 and jQuery. It all worked well locally in FF5, Chrome and Safari.

Once I uploaded to a web site, I get

14条回答
  •  时光取名叫无心
    2020-12-01 10:46

    instead of this

    var defaultLocation = new google.maps.LatLng(lat, lng);
    

    use this

    var defaultLocation = new window.google.maps.LatLng(lat, lng);
    

    and this worked for me.

提交回复
热议问题