I am trying to install Trustpilot invitation code on the receipt page of an eCommerce package called Sellerdeck.
I am trying to obtain the customer's name from a variable which I believe is passed from a Perl script.
This variable contains a line break which splits it over 2 lines.
When I try to allocate it to a javascript variable and run it in the browser I get the error:
Uncaught SyntaxError: '' string literal contains an unescaped line break
Is there a way to assign the variable in javascript so that I don't get an error?
I have sorted this via this method where 'InvoiceName' is the variable passed from the perl script: