2014-03-27 70 views
2

当我尝试在IE8下使用jqplot初始化图形时,出现js错误。jqplot与IE8不能正常工作

的错误是:

return window.G_vmlCanvasManager.initElement(P) 
在jquery.jqplot.min.js文件

错误的是:“财产initElement未定义或空”

我怎么能解决呢?

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

我在IE8 Emulator模式下使用IE11。 IE浏览器> 8 =>没有问题。

回答

7

您是否包含excanvas

From their site

笔记,excanvas只要求IE版本低于9 IE 9 包括用于画布元件的本地支持,并且不需要 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

+0

谢谢,那是我的错误。没有条件评论它的工作! –

+0

超级,它是否回答你的问题呢? –