I am trying to implement excanvas so that my script works in IE as well as in standards compliant browsers. I include jquery, excanvas, and then my script. I create a canvas element as follows:
data.canvas = $(document.createElement('canvas')).attr('width', data.fontwidth * 80 + 'px').attr('height', data.fontheight * 25 + 'px');
$this.append(data.canvas);
But when I try ctx = data.canvas[0].getContext('2d');, I get the error " Object doesn't support this property or method' error on that line. Additionally I'm getting anInvalid argument" on line 160 inside excanvas.js.
My complete code is here . The working page (in everything except IE) is here . The excanvas version I'm using is here .
The update solved the second error. I had to add an element before calling the init function.
source
share