What is better in this case, document.createElement or document.write?
问题 Ok, so I'm making an html5 canvas/javascript game. I'm playing around with the idea of making it available to anyone who wants to put the game on their own website, via one little script snippet that links to an external js file. Inside the external js file, the whole entire game is included, all I need is to find the best way to create a canvas tag via javascript code. The external js link: <script src="http://host.com/game.js"></script> Here is the single line of canvas code that I need to