“google未定义”当在Firefox中远程使用Google Maps V3时 [英] "google is not defined" when using Google Maps V3 in Firefox remotely

查看:277
本文介绍了“google未定义”当在Firefox中远程使用Google Maps V3时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的难题:
我有一个使用Google Maps V3和jQuery的页面。这一切都在本地在FF5,Chrome和Safari。

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.

一旦我上传到网站,我在第一行获得一个google未定义错误,我尝试使用一个google对象

Once I uploaded to a web site, I get a "google is not defined" error on the first line that I try to use a google object

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

只出现在FF strong>(即,如果我将文件加载到本地的FF,它工作得很好)。

It only occurs in FF and only occurs remotely (i.e., if I load the file into FF locally, it works well). Chrome and Safari seem to be working great regardless, as is my Android and iPod browsers.

这里是我到目前为止所尝试的:

Here's what I tried so far:


  1. 已移动< script type =text / javascriptsrc =http://maps.google.com/maps/api/js?sensor= < head> 部分的顶部。

  2. >< / script>将 $(function(){...}); 的所有内容移动到 initialize()添加< body onload =initialize()>

  3. 使用脚本和CSS文件顺序播放

  4. 粘贴了网址 http://maps.google.com/maps/api/js? sensor = false 进入FF地址框并验证我正在获取正确的脚本

  1. Moved <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> to top of the <head> section.
  2. Moved all content of $(function() {...}); to a function called initialize() and added <body onload="initialize()">
  3. Played with scripts and css files order
  4. Pasted the URL http://maps.google.com/maps/api/js?sensor=false into FF address box and verified I'm getting the legit script

但是由于这只发生在FF在远程机器上工作得很好,否则,我不认为它与我的代码有任何关系。也许FF5中的装载顺序是拧紧的。也许它优先网络资源不同于其他浏览器。我真的不知道在这一点上做什么。

But since this is only happening in FF on a remote machine and works well otherwise, I don't think it has anything to do with my code. Maybe the load order in FF5 is screwed. Maybe it prioritizes network resources differently than other browsers. I really do not know what to make of it at this point.

任何帮助都很感激。

Guy

Any help is appreciated.
Guy

更新:

只是想添加以下事实:在Mac上尝试上述操作后,我在Windows中尝试过FF5,相同的行为。

为了良好的测量,我尝试了Pale Moon以及相同的结果。 Chrome 14,Opera 11.50和甚至frickin'IE9(这不包括在测试计划中)工作。它只是FF5,现在在Mac和Windows 7,在该页上失败。

Update:
Just wanted to add the following fact: After trying the previous on a Mac, I tried FF5 in Windows, and have replicated the exact same behavior.
For good measure, I tried Pale Moon as well - same results. Chrome 14, Opera 11.50 and even frickin' IE9 (which wasn't included in the test plan) work. It just FF5, now on both Mac and Windows 7, that fails on that page.

推荐答案

我多次遇到google未定义。
可能Google脚本有一些问题,不能很好地加载FF-addon
BTW。
FF具有重新启动选项(如窗口重新启动)
帮助>重新启动加载项已禁用

I faced 'google is not defined' several time. Probably Google Script has some problem not to be loaded well with FF-addon BTW. FF has restart option ( like window reboot ) Help > restart with Add-ons Disabled

这篇关于“google未定义”当在Firefox中远程使用Google Maps V3时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆