Enonic version: 6.0.0
OS: Mac OSX
I have a page component view file with some JavaScript in it. I get an error with “&&”. I get a different error with “&&
” so it seems I cannot use “and” operator.
if( width >= 320 && width <= 599 ){
device = 'phone';
}
Caused by: org.xml.sax.SAXParseException: The entity name must immediately follow the ‘&’ in the entity reference.
if( width >= 320 && width <= 599 ){
device = 'phone';
}
Caused by: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
If I use <
then the page loads, but I get a JavaScript error in the browser.
if( width >= 320 && width <= 599 ){
device = 'phone';
}
Uncaught SyntaxError: Unexpected token ;
All of the error messages above point to the first line of the “if” statement.