Although it may seem to be obvious for experienced web page authors, it was a discovery for me: XHTML does not understand special symbols “&” and “<” if written directly. So it’s impossible for example to perform “and” operation (&&) in javascript on the page.

There are two solutions for that:

1) Use CDATA for such sections of data, f.e.

  1. <script type="text/javascript">
  2.   //< ![CDATA[
  3.      function enableDisableRegisterButton(element1, element2) {
  4.         registerButtonWrapper.disabled = !(element1.checked && element2.checked);
  5. ...
  6.      }
  7.   ]]>
  8. </script>

>> more…