jqplot与IE8无法正常工作

时间:2014-03-27 11:01:33

标签: javascript jquery internet-explorer-8 jqplot

当我尝试使用IE8下的jqplot初始化图形时,我收到了js错误。

错误发生在:

return window.G_vmlCanvasManager.initElement(P)

在jquery.jqplot.min.js文件中。

错误是关于:“属性initElement未定义或为空”

我该如何解决?

此外,jqplot的official site会出现同样的错误。

我正在使用IE11和IE8仿真器模式。 IE> 8 =>没问题。

1 个答案:

答案 0 :(得分:7)

您是否包含excanvas

From their site

  

注意,只有9以下的IE版本才需要excanvas。IE 9   包括对canvas元素的本机支持,不需要   excanvas

Note, if you are using IE10+ and are emulation IE8, conditional comments does not work.

所以而不是

<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->

试试

<script language="javascript" type="text/javascript" src="excanvas.js"></script>

如果它有效,它应该在真正的IE8中工作。您可以保留条件注释或使用功能选项来包含excanvas.js