Question

I am writing a JavaScript implementation of Conway's game of life. It seems like using the to draw my grid is a cool new way to proceed rather than making a HTML table and keeping track of cell ids, but if I write <canvas> in XHTML 1.1 which I usually write, will the code work? Or should I go for table method to draw my base grid for the game?

Was it helpful?

Solution

The canvas element is not part of XHTML 1.1, so the question as such is meaningless. But if you meant to ask whether you can use canvas together with an XHTML 1.1 doctype, then the answer is yes. Browsers don’t care about the doctype, except for determining browser mode (“standards” vs. “almost standards” vs. “quirks”), and this affects many things, but not the recognition and implementation of canvas markup.

OTHER TIPS

If the canvas-tag works depends on the browser that is used to view it. I believe it can be used in any major browser for some time now. See http://caniuse.com/#search=canvas and this question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top