Added JavaScript support for drawing directly to <canvas> tags.

I added a little function based on createImgTag() that writes to a <canvas> tag instead for a project I was working on. Thought somebody else might want to be able to do this, so here it is.