2014-03-27 111 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

超級,它是否回答你的問題呢? –