Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

Optimizing Your Pages for Speculative Parsing

When this document talks about unbalanced elements, what does it mean, precisely? For example, in HTML "<p><div></div>" is a balanced construction, because the "</p>" element is implicit before the new block level element. This is valid HTML, and is parsed in to the DOM as "<p></p><div></div>" — so when this document talks about being balanced, does it mean before or after being parsed as HTML?

<hr>

I note this is a Draft.

<hr>

I find it odd that the same code fragment is given as both a good and a bad example.

<script>document.write("<div></div>");</script> is OK.

<script>document.write("<div></div");</script> is bad.

Notice it is not the same! The is a > missing in the second example.

Document Tags and Contributors

 Contributors to this page: nslater, aceman-bugzilla, John99
 Last updated by: nslater,