Flare complains about Javascript operator in script

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
ghillerson
Propeller Head
Posts: 85
Joined: Wed Mar 05, 2014 10:22 pm
Location: Near Santa Cruz, CA
Contact:

Flare complains about Javascript operator in script

Post by ghillerson »

I'm trying to add Bing tracking code (from my SEO person) to a Flare 11 masterpage, and Flare is complaining "An error occurred while parsing EntityName. ..." I have a good understanding of Javascript, and this is the first time I've tried to directly add code into a master page.

The offending statement is:

Code: Select all

            s && s !== "loaded" && s !== "complete" || (f(), n.onload = n.onreadystatechange = null)
If I change the ampersands to anything else, Flare is happy. But '&&' is a valid operator in JavaScript, so I'm confused. DreamWeaver doesn't complain about the same script in a web page, and it seems to work just fine. What do I have to do for Flare to not complain about those ampersands?

g
dorcutt
Sr. Propeller Head
Posts: 234
Joined: Thu May 15, 2014 12:16 pm

Re: Flare complains about Javascript operator in script

Post by dorcutt »

Try using the XML multiline comment tag inside the script tag. Javascript should ignore the comment tag and it should hide the offending line from Flare.

Code: Select all

<!--

-->
-Dan, Propellerhead-in-training
ghillerson
Propeller Head
Posts: 85
Joined: Wed Mar 05, 2014 10:22 pm
Location: Near Santa Cruz, CA
Contact:

Re: Flare complains about Javascript operator in script

Post by ghillerson »

Thank you.
jimgilliam
Propeller Head
Posts: 84
Joined: Tue Jun 04, 2013 9:49 am
Location: Arkansas, U.S.A.

Re: Flare complains about Javascript operator in script

Post by jimgilliam »

I'm having a similar issue in Flare. Bing gives the code below, and Flare says the equal sign is an unexpected token. Why doesn't it work?

Code: Select all

<script type="text/javascript" 
    id="bcs_js_snippet"
    src="https://ui.customsearch.ai/api/ux/render?customConfig=555555555&market=en-US&safeSearch=Moderate&q=">
</script>
:flare:
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: Flare complains about Javascript operator in script

Post by AlexFox »

in HTML, & signifies the start of a character reference so your URL is making Flare think it needs to parse &market=en-US into a character, which obviously it cannot as there is no character reference of that name.

You'll need to use the character reference for & which is &
jimgilliam
Propeller Head
Posts: 84
Joined: Tue Jun 04, 2013 9:49 am
Location: Arkansas, U.S.A.

Re: Flare complains about Javascript operator in script

Post by jimgilliam »

Thanks, AlexFox! That worked.
:flare:
Post Reply