Now with the more recent XHTML standards, the <script> and </script> tags are considered as PCDATA (parsed character data). This is parsed by the validator and hence results in scripting being parsed and finally breaking your HTML page.
There are 2 ways to fix this problem:
2. Defining CDATA in script tags
In case there are just one or two lines within the script tags, it is a good practice to enclose these between CDATA tags. This tag tells the validator that the statements enclosed by CDATA are to be treated like character data.