[Solved] “The entity name must immediately follow the ‘&’ in the entity reference.” : JSF error

You’re editing a scripted page and get this message when saving:

The entity name must immediately follow the ‘&’ in the entity reference.

If you are trying to add a condition inside your if loop like

if(aa && bb)

For the javascript to be valid it must be used within CDATA tag:

<script type="text/javascript">
<![CDATA[
// code goes here
]]>
</script>

reference: http://wiki.editme.com/EscapingAmersandsInPageScripts