How does one validate html that's generated from JS running in the browser?

Posted by Henry Rose on Stack Overflow See other posts from Stack Overflow or by Henry Rose
Published on 2011-01-14T00:39:43Z Indexed on 2011/01/16 6:53 UTC
Read the original article Hit count: 189

Filed under:
|
|

The page in question has very skeletal html sent over the wire to facilitate the building of a complicated UI in javascript.

I'm now encountering a strange browser compatibility issue that feels very much like I've got a markup problem somewhere on the page.

I've validated the page as it comes across the wire using the W3C tool and ensured there are no issues in that html. I've also tried validating the output of running on the browser console:

document.getElementsByTagName('html')[0].outerHTML

I find that the output of the above introduces lots of new issues, such as removing the trailing '/' in self closing tags. This added noise is distracting, but it also makes me uneasy about validating this method.

How do you validate markup that's rendered client side?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html