I check if a word is present in a string using javascript. I know i can do this another way, but this would make the template i am working on way to long. So I added the following string in a if block and it reports an error even in javascript tester everything is fine:
({-Variable.parse_normal_free-}.indexOf("$") != -1) && ({-Variable.Parse_normal_title-}.indexOf("$") != -1 )
Here {-Variable.parse_normal_free-} and {-Variable.Parse_normal_title-} are string variables.
After that I tried to do the same thing using "own javascipt" block and i am still getting an error.
({-Variable.parse_normal_free-}.indexOf("$") != -1) && ({-Variable.Parse_normal_title-}.indexOf("$") != -1 );
What is the problem. Can i actually use variable from ZP in the javascript block this way. Thanks.
({-Variable.parse_normal_free-}.indexOf("$") != -1) && ({-Variable.Parse_normal_title-}.indexOf("$") != -1 )
Here {-Variable.parse_normal_free-} and {-Variable.Parse_normal_title-} are string variables.
After that I tried to do the same thing using "own javascipt" block and i am still getting an error.
({-Variable.parse_normal_free-}.indexOf("$") != -1) && ({-Variable.Parse_normal_title-}.indexOf("$") != -1 );
What is the problem. Can i actually use variable from ZP in the javascript block this way. Thanks.