javascript - Google Gauges 可以在 IE 中正常工作吗?

标签 javascript internet-explorer firefox cross-browser google-gauges

编辑 2

有人了解latest post吗?他是如何让它工作的:

"i used https instead of http inside script tag.It worked."
-Comment 22 by nithin...@gmail.com, Feb 07 (3 days ago)

他指的是哪个标签?那是你从谷歌加载javascript的地方吗? (我在那里尝试了一个 https,没有运气。)其他方法似乎不起作用......


我在 Firefox 中使用了 Google 仪表:
http://code.google.com/apis/visualization/documentation/gallery/gauge.html

但在 IE 8 中不起作用。

我还注意到 IE 中的“Google Playground”会弹出安装 Chrome 的弹窗:
http://code.google.com/apis/ajax/playground/?type=visualization#gauge

我看过这篇文章,但不是真正的解决方案:
http://code.google.com/p/google-visualization-api-issues/issues/detail?id=5

首先,问题到底是什么?

我想更深入地了解为什么它不起作用。

接下来,有什么想法吗?

谢谢!

编辑

赏金以 100 点开始。在 7 天结束时寻找“最佳”(由其他用户投票)的答案以在 IE 中工作

最佳答案

看来 additional information可在 the link you've provided: 的评论中找到

Found that google is using comment on top of the doctype. This causes doctype declaration not working properly. And thus makes the gauge drawn.

<!--
  copyright (c) 2009 Google inc.

  You are free to copy and use this sample.
  License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

P/S: This is not the workaround.

Comment 6提供了一个伪解决方法:

Are there any plans on getting this bug fixed for IE8? Removing the doctype from the page will get the gauge to work in IE8, however, this will cause rendering problems with other elements shown in the page.

Comment 8提供了一种尝试强制兼容模式的解决方法:

Hi, not a solution but a work around that works fur us right now. By adding a HTTP Response header X-UA-Compatible = IE=EmulateIE7

This could be done in IIS or by adding the following section to web.config

<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>

而且我认为问题本身应该由 Google 解决或由 IE 团队处理。我将不讨论这在政治上如何运作。

祝您的可视化工作顺利!

关于javascript - Google Gauges 可以在 IE 中正常工作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4301042/

相关文章:

Javascript 函数不适用于 Internet Explorer

javascript - js变量定义后在IE中未定义

javascript - 动态解除绑定(bind)XBL的动态方式

java - 使用 geckoddriver 时出错 : Found argument '--websocket-port' which wasn't expected

javascript - 避免创建 Canvas 造成的 Javascript 内存泄漏

javascript - jQuery 函数被错误调用。

javascript - 使用 jquery 从复选框中获取标签值

javascript - 颜色作为 for 循环中的 JQuery 变量

css - IE 中 xml 标准兼容模式的 Doctype

javascript - 如何将用户脚本转换为 Firefox 附加组件