[inline]
[script type=”text/javascript”]
document.write(“hello world!”);
var c2=document.getElementById(“myCanvas2”);
var ctx2=c2.getContext(“2d”);
ctx2.moveTo(10,10);
ctx2.lineTo(150,50);
ctx2.lineTo(10,50);
ctx2.stroke();
[/script]
[/inline]
So I’m experimenting with creating drawings using HTML5. And it works (mostly)!! I have to hardwire in paragraph breaks, but otherwise it works so far.
The key references:
- w3schools.com: HTML5 Canvas: for the code for the drawing above.
- Volcano’s Inline Javascript plugin for WordPress to make it work on this blog.
- The page for Opera developers is also a great HTML5 drawing reference.
- Dive into HTML5 is another excellent resource.
- Bill Mill’s canvas tutorial.