Canvas Emulation in IEMarch 18, 2009
The <canvas> tag in HTML5 is awesome, plain and simple, and if you’ve ever worked with it, you’re aware. You also know that there’s one big, glaring, red-light-on-the-nuclear-submarine problem: Internet Explorer doesn’t support <canvas>. Not in IE 8, and certainly not in 7 or 6; together these browsers make up a sizable chunk of web users. You can either ignore this population, or not use <canvas>. In Seadragon Ajax, we’ve utilized <canvas> when we detect Firefox or Opera, and fall back on different methods in other browsers, even those with <canvas> support. This is because the implementation of <canvas> in the other browsers doesn’t support sub-pixel rendering (we’re looking at you Chrome and Safari); check out the gallery in Firefox and another browser, and you’ll quickly see a difference.
You can also do something a little unorthodox; you can emulate <canvas> functionality using various methods. ExCanvas is one way to accomplish this, though from searching around, you can see that there are some limitations. You can also try using Flash to get <canvas> functionality, my favorite write-up being on Aza Raskin’s blog. It’s fantastic to see smart people working on this problem, so that we can all make use of HTML5 goodness on the next generation of web experiences.