Comment in the last line of Text Area JavaScript breaks JavaScript, Text Area and Visualizations on the page.

Comment in the last line of Text Area JavaScript breaks JavaScript, Text Area and Visualizations on the page.

book

Article ID: KB0080664

calendar_today

Updated On:

Products Versions
Spotfire Analyst 7.0 and lower

Description

When a Text Area includes JavaScript ending with a comment (lines beginning with "\\"), the JavaScript may not execute, or the Text Areas and Visualizations on the same page may be disabled (unresponsive / greyed out). This behavior has changed between version 6.5 (and earlier) and 7.0, so this may be more visible when using 7.0 to open analyses from earlier versions.

Symptoms:
In Spotfire version 7.0:
 - Visualizations on the same page will be greyed out/not visible.
 - The Text Area will be unresponsive (unable to right click and edit)
 - The following error will be seen in the Status Bar:

Type: SyntaxError
Message: Expected '}'
Stacktrace: SyntaxError: Expected '}'
at evaluate (http://localhost:8001/?package=js:6302:62)
at Anonymous function (http://localhost:8001/?package=js:2239:111)
at each (http://localhost:8001/?package=js:43:65)
at updateDocument (http://localhost:8001/?package=js:2239:35)
at receiveCallbackFromRequest (http://localhost:8001/?package=js:2233:80)
at Ajax.receiveCallbackFromRequest (http://localhost:8001/?package=js:2222:118)
at socket.onmessage (http://localhost:8001/?package=js:7139:1)
 

In Spotfire versions 6.5 and lower:

 - The JavaScript will not execute.

Resolution

This is caused by a defect which makes JavaScript with a comment (lines starting with "\\") in the last line to either fail to execute or freeze the text area and other visualizations on the same page.

To resolve, upgrade to Spotfire version 7.5 or higher.

If you are running Spotfire 7.0,  you will need to revert to an earlier version of the report where the JavaScript was not present, or you will need to recreate the problematic page. If you are running Spotfire version 6.5 or earlier, open the analysis file in that version and remove the comment from the last line of the JavaScript:
 - Right click on Text Area > Edit HTML > Select the JavaScript > Click Edit > Click Edit > Remove all comments from the end of the script.

Issue/Introduction

Comment in the last line of Text Area JavaScript breaks JavaScript, Text Area and Visualizations on the page.