[英]Where does Google keep this file used for Google Visualization can I make it local to my site? Also, any examples of code to get gauges to work in IE?
EDIT 编辑
Please see the produced html and Javascript here: 请在此处查看生成的html和Javascript:
http://jsfiddle.net/GregMcNulty/K6Vrb/1/ http://jsfiddle.net/GregMcNulty/K6Vrb/1/
According to this Comment 4 - the comment at the beginning of the file is causing issues. 根据此注释4- 文件开头的注释引起了问题。
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 . 我加载的唯一文件是: https : //www.google.com/jsapi ,如示例所示。
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? 因此,如果我能弄清楚它的调用时间和方式,是否可以在我的网站上将此文件设置为本地文件,而不是从Google调用它。...并对其进行编辑以删除评论,这样我就可以使用Google仪表在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? 任何人都有一个特定的示例,他们可以展示如何使IE与google可视化/图表一起工作?
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... ...等等...
The solution is easy. 解决方案很简单。
The DOCTYPE in the comment is the DOCTYPE in your web page. 注释中的DOCTYPE是您的网页中的DOCTYPE。 The one that calls the Google Visualization javascript.
调用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. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
HTML标记的顶部。 So basically, to make it work, in IE8, omit the DTD before the html
opening tag. 因此,基本上,要使其工作,在IE8中,请在
html
开头标记之前省略DTD。
I've tried other DTDs, especially the xhtml 1 strict, known to make IE behave. 我尝试了其他DTD,尤其是xhtml 1 strict,以使IE表现良好。 No luck yet.
还没有运气。
Update 更新
By the way, when I add the dtd inserted by visual studio (antique 4.01) it still works. 顺便说一句,当我添加Visual Studio(antique 4.01)插入的dtd时,它仍然有效。 I've also added your header.
我还添加了您的标题。 The file below works fine in IE8 for me.
下面的文件对我来说在IE8中工作正常。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>
Your Levels
</title>
<!-- 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>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', { packages: ['gauge'] });
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Label');
data.addColumn('number', 'Value');
data.addRows(3);
data.setValue(0, 0, 'Memory');
data.setValue(0, 1, 80);
data.setValue(1, 0, 'CPU');
data.setValue(1, 1, 55);
data.setValue(2, 0, 'Network');
data.setValue(2, 1, 68);
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
var options = { width: 400, height: 120, redFrom: 90, redTo: 100,
yellowFrom: 75, yellowTo: 90, minorTicks: 5
};
chart.draw(data, options);
}
</script>
</head>
<body>
<div id='chart_div'></div>
<form name="aspnetForm" method="post" action="Stats.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
</form>
</body>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.