I simple tile engine using html5 canvas: http://jsfiddle.net/fFsBu/18/
The code should be self explanatory since it's so short. The image on the right is for the reference for getting numbers of tile images.
For unknown reason the image is not loaded sometimes (just click run in jsfiddle). Some advice would be helpful on that. :)