<!--[if lt IE 9]><script type="text/javascript" src="excanvas.compiled.js"></script><![endif]-->But when IE got to the second line below, it would die with "Object doesn't support this property or method".
var canvas = document.getElementById("mycanvas"); var context = canvas.getContext("2d");The problem was that excanvas.js had not been fully loaded, so when IE hit that line, the canvas object didn't have a "getContext()" method. This happened because I was using this to start my javascript,
$(document).ready(letsStart);The "ready()" method kicks off when all the DOM has (pretty much) loaded, but excanvas.js still wasn't loaded. The solution was to replace "$(document).ready(letsStart);" with
window.onload = letsStart;Then my canvas app started working fine with an old version of IE.
BTW, my five year old daughter made this with www.MyDoodleDot.com
1 comment:
Thank you. I've been searching for "inconsistencies with excanvas" until I stumbled across your blog. My canvas would load the first time in IE8 and I would have to restart it to make canvas work again.
Post a Comment