Hacker News new | ask | show | jobs
by khuey 4888 days ago
I know this isn't the point of your comment, but modifying document.body.innerHTML and then using document.all to access it is probably the worst possible way to append an element to the document and then use it.
1 comments

To avoid some of the bad you can put this before the other Javascript files because that way you don't destroy event listeners.

Also I changed "document.all" for "document.body.childNodes" that is cross-browser and can't be compromised.