Hi, I'm trying to use AND operator but it does not seems to be working
if I write like this:
This does not work.
But if write it like this:
This is working.
Any idea how to use 'AND' operator ? or operator works fine though
Hi, I'm trying to use AND operator but it does not seems to be working
if I write like this:
This does not work.
But if write it like this:
This is working.
Any idea how to use 'AND' operator ? or operator works fine though
hi, you're mixing up javascript with krpano script.
javascript logical operators -->
https://developer.mozilla.org/en-US/docs/Web…gical_operators
hi, you're mixing up javascript with krpano script.
javascript logical operators -->
https://developer.mozilla.org/en-US/docs/Web…gical_operators
I'm using this in action.xml
there are normal actions and type="javascript" actions
https://krpano.com/docu/xml/#action
https://krpano.com/docu/xml/#action.normal
https://krpano.com/docu/xml/#action.js
normal actions use action code https://krpano.com/docu/actions/#if
javascript actions use javascript. https://developer.mozilla.org/en-US/docs/Web…gical_operators
to be able to use the & character inside xml actions you must use the CDATA tag
(see here https://krpano.com/docu/xml/syntaxrules/#characters)
<action name=".." type="javascript"><![CDATA[
if(a && b) console.log("c");
]]></action>
This didn't worked for me
But
if(a && b) console.log("c");
This worked for me, Thank you so much
<action name="test" type="javascript" autorun="onstart"><![CDATA[
if(1 && 1) alert("it works");
]]></action>
fyi, this doesn't need && thats what the CDATA tag is for :
https://en.wikipedia.org/wiki/CDATA
Don’t have an account yet? Register yourself now and be a part of our community!