I found also this answer:
With HTML pages on the web you can just include the required
that is therefore ignored by the validator. The same is not true if
you follow the more recent XHTML standards in setting up your web
page. With XHTML the code between the script tags is considered to be
PCDATA (parsed character data) which is therefore processed by the
far as the validator is concerned).