Google 将用于 Google 可视化的文件保存在哪里?我可以将其设置为我网站的本地文件吗?另外,有没有让仪表在 IE 中工作的代码示例?
编辑
请在此处查看生成的 html 和 Javascript:
http://jsfiddle.net/GregMcNulty/K6Vrb/1/
根据此评论 4 - 开头的评论文件 导致问题。
我的问题是,这是哪个文件以及何时加载?
我加载的唯一文件是:https://www.google.com/jsapi,如< href="http://code.google.com/apis/visualization/documentation/gallery/gauge.html#Example" rel="nofollow">示例。
因此,如果我能弄清楚它的调用时间和方式,我可以将其作为我网站上的本地文件,而不是从谷歌调用它......并编辑它以删除注释,这样我就可以让谷歌仪表正常工作在IE中?
谢谢。
不确定为什么将元数据放入头部对我也不起作用?这应该在所有情况下都有效吗?
任何人都有一个具体的例子可以展示他们如何让谷歌可视化/图表与 IE 一起使用?
没有任何文档类型的头部,但是,它使身体的其余部分(未显示)变得非常糟糕......
<html>
<head><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>
Your Levels
</title>
<!-- Google JavaScript for gauges -->
<script src='http://www.google.com/jsapi' type='text/javascript' ></script>
<!-- Style Sheet -->
<link href="Styles/EliteCircle.css" rel="stylesheet" type="text/css" />
<!-- My local JavaScript File -->
<script src="Scripts/JScript.js" type="text/javascript"></script>
</head>
<body>
<form name="aspnetForm" method="post" action="Stats.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
等等......
EDIT
Please see the produced html and Javascript here:
http://jsfiddle.net/GregMcNulty/K6Vrb/1/
According to this Comment 4 - the comment at the beginning of the file is causing issues.
My question is, which file is this and when does it get loaded?
The only file I load is: https://www.google.com/jsapi as shown in the example.
So if I can figure out when and how it is called, can I make this a local file on my site instead of calling it from google.... and edit it to remove the comments, so i can get the google gauges to work in IE?
Thanks.
Not sure why putting the meta data in the head is not working for me either? Should that work in all cases?
Anyone have a specific example they can show how they got the google visualization/charts working with IE?
The head without any doc type, however, it renders the rest of the body (not shown) terribly...
<html>
<head><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>
Your Levels
</title>
<!-- Google JavaScript for gauges -->
<script src='http://www.google.com/jsapi' type='text/javascript' ></script>
<!-- Style Sheet -->
<link href="Styles/EliteCircle.css" rel="stylesheet" type="text/css" />
<!-- My local JavaScript File -->
<script src="Scripts/JScript.js" type="text/javascript"></script>
</head>
<body>
<form name="aspnetForm" method="post" action="Stats.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
...etc...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决办法很简单。
注释中的 DOCTYPE 是您的网页中的 DOCTYPE。调用 Google Visualization javascript 的那个。
证明:
位于 HTML 标记顶部。
因此,基本上,要使其正常工作,请在 IE8 中省略
html
开始标记之前的 DTD。我尝试过其他 DTD,尤其是 xhtml 1 strict,已知它可以使 IE 表现良好。还没有运气。
更新
顺便说一句,当我添加由 Visual Studio(古董 4.01)插入的 dtd 时,它仍然有效。
我还添加了您的标题。下面的文件对我来说在 IE8 中运行良好。
The solution is easy.
The DOCTYPE in the comment is the DOCTYPE in your web page. The one that calls the Google Visualization javascript.
Proof:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
on top of the HTML tag.So basically, to make it work, in IE8, omit the DTD before the
html
opening tag.I've tried other DTDs, especially the xhtml 1 strict, known to make IE behave. No luck yet.
Update
By the way, when I add the dtd inserted by visual studio (antique 4.01) it still works.
I've also added your header. The file below works fine in IE8 for me.