Live Scripting HTML Parser

Markup to test (, Live DOM Viewer)

Log

parse: start token: start-tag "html" token: char " " token: start-tag "head" token: end-tag "head" token: start-tag "body" token: char " " token: start-tag "p" token: char " " token: start-tag "script" token: char " document.write ('aaaaaaa" token: char "<" token: char "/p>" token: char "<" token: char "script>document.write("cccccc");" token: char "<" token: char "/', 'script>bbbbbb'); " token: end-tag "script" insertion point: set to 0 (before " <p> ") Running a script: start executing a script block: start load event fired at the script element document.write: start

Notes

This is a simplified implementation of HTML5 Parsing Algorithm. It only implements script-related part of the algorithm. Especially, this parser:

For some reason, this parser does not work in browsers that do not support JavaScript 1.5.