简体   繁体   English

Google将该文件用于Google可视化的位置在哪里?我可以将其本地化吗? 另外,是否有代码示例可以使IE中的量规工作?

[英]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: 证明:

  1. Take the Gauge example on the Google Visualization page. 以Google可视化页面上的仪表为例。
  2. Cut and paste it in a file g.html on your desktop 将其剪切并粘贴到桌面上的g.html文件中
  3. do not add any DTD <!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. 不要在其上添加任何DTD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> HTML标记的顶部。
  4. Open it in IE8 => works 在IE8中打开它=>可以
  5. add the DTD shown in 3 => broken. 添加3 =>损坏的DTD。

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.

相关问题 Google Gauges可以在IE中正常工作吗? - Can Google Gauges work properly in IE? 为什么我的Ajax不能在Google Chrome或IE上运行,而在FireFox上运行,又如何使它工作? - Why Does my Ajax Not work on Google Chrome Or IE but works on FireFox, And how can i make it work 无法让我的 Google 可视化饼图和表格溢出滚动条工作 - can't get my Google Visualization pie chart and table overflow scrollbar to work 如何使我的文件下载在IE和safari上正常工作? - How can I make my file download work on IE and safari? 您是否知道为什么我的代码无法正常工作,而单击时却无法获取数字? - Do you have any idea why my code does not work and I can not get the numbers while clicking 如何使此代码在IE中工作? - How can I make this code work in IE? 如何让我的搜索栏与 Google 一起使用? - How can I get my search bar work with Google? 我的代码未显示日期和时间,如何使它起作用? 另外,我可以再次单击该按钮以隐藏/显示日期和时间吗? - My code does not show the Date & Time, how do I make it work? Also, can I click the button again to hide/show the date and time Google云端硬盘应用:如何获取HTML文件以读取code.gs中定义的变量? - Google drive app: How can i get my HTML file to read a varitable defined in code.gs? 谷歌 ie7 代码在网站上不起作用 - Google ie7 code not working on site
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM