Skip to main content
1-Visitor
April 21, 2019
Solved

print new line using JS in ThingWox

  • April 21, 2019
  • 1 reply
  • 5102 views

Hi,

I am trying to return two strings in two next lines but it does not work. Could you please correct the script on what I am missing.

 

var result = "Mashup1" +\n
"Mashup2"

 

Thanks in advance,

Shalini V.

Best answer by ashaban

For that, you should use InfoTables and DataShapes.

1 reply

12-Amethyst
April 21, 2019

var result = "Mashup1" + '\n' + "Mashup2";

Or

var result = "Mashup1" + "\n" + "Mashup2";

 

Both should work.

1-Visitor
April 21, 2019

Hi @ashaban,

Thanks for your swift reply. I tried both the script but it prints on the same line. Could you please tell me if there is any other way to achieve it?

Result.png

12-Amethyst
April 21, 2019

The result should be used in a mashup.

Bind the result string to a Text Area widget.