Question john.smith4237 · Aug 14, 2024

Getting syntax error using &&

Hi Guys

I'm getting  syntax error using && operator in using JS in my Zen page, the || works fine!?

Thanks

Product version: Ensemble 2018.1

Comments

Vitaliy Serdtsev · Aug 15, 2024

Try this:

<FONT COLOR="#000080">XData </FONT><FONT COLOR="#000000">Script
{
<</FONT><FONT COLOR="#000080">script </FONT><FONT COLOR="#800000">type</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#008000">"text/javascript"</FONT><FONT COLOR="#000000">>
var v1=1;
var v2=2;
function Colors() {
  if (v1=1</FONT><FONT COLOR="#800080">&amp;&amp;</FONT><FONT COLOR="#000000">v2=2) {
    alert('</FONT><FONT COLOR="#800080">&amp;&lt;&gt;&quot;</FONT><FONT COLOR="#000000">');
  }
}
</</FONT><FONT COLOR="#000080">script</FONT><FONT COLOR="#000000">>
}</FONT>
0