【问题标题】:Google geomap with jquery fails in IE带有 jquery 的 Google 地理地图在 IE 中失败
【发布时间】:2009-04-13 10:18:53
【问题描述】:

我在 Internet Explorer 中遇到了 google 的 geomap 与 JQuery 一起失败的问题。

否则在 Firefox 中它看起来像这样:


(来源:clip2net.com

js 引用来了

<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABCDEFG">
</script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/js/ui.core.js" type="text/javascript"></script>
<script src="/js/ui.accordion.js" type="text/javascript"></script>


(来源:clip2net.com

请任何人帮忙...

感谢您的建议。

【问题讨论】:

  • 错误是什么?它是如何失败的?
  • 感谢您的回复,我已经编辑了我的帖子并添加了错误快照
  • 我在页面上有手风琴 (ui),当我从页面中删除它们时,一切正常。但那里需要它......

标签: javascript jquery internet-explorer jquery-ui google-maps


【解决方案1】:

在 IE 中调试 javascript 很困难,但在没有实际 url 或使用缩小的 javascript 时更难调试。您可能希望暂时切换到完整的非缩小版 jquery,以便您可以找到发生错误的行并查看发生了什么。

此外,在 firefox 中,您可以尝试使用 firebug 来查看它是否会引发任何错误。即使地图在 Firefox 中运行,它也可能会从 IE 无法恢复的错误中静默恢复。

【讨论】:

    【解决方案2】:

    您是否使用 console.log() 调用来打印到萤火虫?这将导致 IE 抛出错误。如果是这样的话,可以尝试这样的事情

    var a = "hello";
    try
    {
    console.log(a);
    }
    catch(err)
    {
    alert(a);
    }
    

    这将用 IE 中的普通旧警报替换 console.log

    【讨论】:

      【解决方案3】:

      通过从页面中删除 JQuery.UI.Dialog 来修复。

      【讨论】:

        【解决方案4】:

        #map { float:left; width:700px; height:500px; margin-top:10px; }
        

        就是这样:-)

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多