I'm using Javascript with netsuite, and the command below will directly substitute the value from the backend into the javascript.
title = "<%=getCurrentAttribute('item','storetitle')%>"
The issue is, if the <%= > command directly substitutes the below:
The tube is 8" long
the title escapes itself, i.e.
title = "The tube is 8" long"
The obvious solution is just to wrap it in single quotes, i.e.
title = 'The tube is 8" long'
This works for all titles which have a double quote in them, but for all titles with single quotes in them, I'm stuck as it would escape those.
The tag appears to just directly substitute itself into the javascript, is there any way to either:
I believe in javascript you can use the \ character to escape. For example "The tube is 8\" long", \" will be considered as a " character. You can also check if the nlapiEscapeXML will work for you.