HTMLCanvas 'getContext' is not a supported property or method

跟風遠走 提交于 2019-12-04 05:07:03

After inserting <meta http-equiv="X-UA-Compatible" content="chrome=1, IE=edge"> we have reduced the bug count a lot, we still have a few, but that could be users logging in with weird browsers that the chromeframe install check doesn't catch.

chrome=1 means 'use chrome frame' if its there.

IE=edge means 'use highest possible version of IE'.

So i'll go with that for now.

as far as i know IE9 fully supports canvas tag. But user should make sure he is not in compatibility mode. But just to avoid the problem i suggest u using excanvas. If you dont know the how download excanvas and add following link

<!--[if lt IE 9]><script src="../excanvas/excanvas.original.js"></script><![endif]-->

Have you considered the possibility that users don't know which version of IE they are using and are reporting it incorrectly?

From Instructions

Dynamically created elements If you have created your canvas element dynamically it will not have the getContext method added to the element. To get it working you need to call initElement on the G_vmlCanvasManager object.

var el = document.createElement('canvas');
G_vmlCanvasManager.initElement(el);
var ctx = el.getContext('2d');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!