Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top