jonessieka / explorercanvas

Automatically exported from code.google.com/p/explorercanvas
Apache License 2.0
0 stars 0 forks source link

Invalid argument (excanvas.js - line 154) or dinamically created canvas #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi.

I tried to make excanvas work on dinamically created canvas.
Included excanvas.js, created new canvas element 

   var parent = document.getElementsByTagName('body')[0];
   var cnvs = document.createElement('canvas');
   cnvs.width = "300px";
   cnvs.height = "200px";
   cnvs.id = "cnvs_1";
   G_vmlCanvasManager.initElement(cnvs);
   parent.appendChild(cnvs);

But I was given error: Invalid argument (excanvas.js - line 154).
And no graphics of course.

I find out (by placing alert()), that script breaks after 
G_vmlCanvasManager.initElement(cnvs);
But don't get why is that so.

I have the last version of excanvas, WinXP and IE8.

Thnx in advance.

Original issue reported on code.google.com by ffdi...@gmail.com on 12 Mar 2013 at 11:57

Attachments:

GoogleCodeExporter commented 9 years ago
Solved. I replaced G_vmlCanvasManager.initElement(cnvs); behind 
parent.appendChild(cnvs);

Original comment by ffdi...@gmail.com on 12 Mar 2013 at 12:23