This is a demonstration of an XHTML document (served as text/html
)
using a comment within the script
element that is designed to hide
scripts from older HTML user agents. See HTML
comments in scripts for more information
Because the document is parsed with HTML rules, rather than XML rules, the
script element is parsed as CDATA
and is therefore treated as though it is not
commented out. Therefore, the script does work.
If the script executed, you would have seen an alert containing "Hello World!".