图表是在Chrome中呈现的,但不会在FF和IE中呈现 [英] Chart is rendered in Chrome, but not in FF and IE

查看:122
本文介绍了图表是在Chrome中呈现的,但不会在FF和IE中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

H ey there,



我正在开发基于大量PHP和JS代码的小型网络应用程序,并且偶尔在Firefox中打开当前的index.php (我的主要开发者浏览器)。



我很震惊地看到我的主要组件之一,一个图表(由amCharts制作) 。奇怪的是,amCharts的水印是...



现在我认为它只是一个hickup和打开IE,有另一个浏览器进行比较,但是,同样的问题。



我回到Chrome,一切都还好。这真的让我困惑,让我认为这是一个代码问题,例如。一个未封闭的括号。所以我复制粘贴我的代码到几个PHP / JS / HTML验证器,没有任何命中。



此外,我下载了Firefox的Firebug插件希望找到某种错误,但没有找到。



我还试图在我的代码中插入一些console.log段落,看看代码执行是否停止在某些点,也没有运气。所有日志消息都以正确的值显示。



现在我对我的秘诀结束了...



有没有人有一个想法/有类似的问题,知道如何解决这个或什么原因,或我如何能找出导致这种情况的原因。



任何帮助可以提供非常感谢。



最好的问候,
daZza





我微调了console.log命令,基本上回溯了每一个步骤。我现在已经发现了问题,但不知道它的来源。基本上我的整个编程逻辑视图现在分裂了...一个相同的命令在另一个浏览器中返回不同的结果,是什么?



这里有来自问题区域的一些代码段:

  xmlData = xmlHttp.responseXML; 
var x = xmlData.getElementsByTagName(row);
xmlRowCount = x.length;

console.log(Rowcount:+ xmlRowCount);



for(i = 0; i {
对源xml文件中的每一行执行某些操作$ b $现在的问题是,在Chrome中,rowcount正确返回为417. FF返回0(0)我猜也是IE)。



怎么可能?预定义的命令如何返回不同的值?我只是不知道...



Edit2:为了完成浏览器测试,我还下载并测试了Opera。它工作正常,这使得这整个事情甚至陌生人。 IE / FF和Chrome / Opera有什么区别?



PS:这里有两个截图(Chrome和FF)可视化问题:




解决方案

您可以尝试使用以下代码

  var x = xmlData.body.all.tags(row); 

  var x = xmlData.all.tags(row); 

希望它有帮助。


H ey there,

I am developing small web-application based on a lot of PHP and JS code and by chance opened the current index.php in Firefox instead of Chrome (my main dev browser).

I was rather shocked to see that one of my main components, a chart (made with amCharts), was not rendered at all. Strangely enough, the watermark of amCharts is shown...

Now I thought it just a hickup and opened the IE to have another browser for comparison, however, same problem there.

I went back to Chrome and everything is still fine there. This really confused me and made me think that it's a code problem, e.g. an unclosed parenthesis somewhere. So I copy pasted my code into several PHP / JS / HTML validators and none had any hits.

In addition I downloaded the Firebug addon for Firefox hoping to find some kind of error, but there is none to be found.

What I also tried to inserting some "console.log" passages in my code to see whether the code execution stops at some point, no luck either. All log messages are shown with their correct values.

Right now I am kinda at my wits end...

Does anyone have an idea / had a similar problem and knows how to solve this or what causes this or how I could find out what causes this?

Any help you can provide would be greatly appreciated.

best regards, daZza

EDIT:

I fine-tuned the console.log commands and basically backtraced every single step. I now have found the problem, but don't know the source of it. Basically my whole view of logic in programming is breaking apart now... One and the same command returns a different result in another browser, what the hell?!

Here's are some code snippets from the problem area:

xmlData = xmlHttp.responseXML;
var x=xmlData.getElementsByTagName("row");
xmlRowCount = x.length;

console.log("Rowcount: " + xmlRowCount);



for (i=0;i<xmlRowCount;i++)
{
  do something with every row in the source xml file
}

Now the problem is that in Chrome the rowcount is correctly returned as 417. FF returns 0 (I guess IE as well).

How can that be possible? How can a predefined command return different values? I just don't get it...

Edit2: To make the browser test complete, I also downloaded and tested Opera. It works fine there, which makes this whole thing even stranger. What is the difference between IE/FF vs. Chrome/Opera?

PS: Here's two screenshots (Chrome and FF) to visualize the problem:

解决方案

Can you try to use the below code

var x=xmlData.body.all.tags("row");

or

var x=xmlData.all.tags("row");

Hope it helps.

这篇关于图表是在Chrome中呈现的,但不会在FF和IE中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆