An attribute of type text needs to be generated within a javascript.
Some records have carriage returns inserted by the user and these need to be passed to javascript in form \n. However when I place
<%= uc.main_text %>
within the javascript, it returns carriage returns
Salties at bottom...
what happens here I am not certain
when \n is needed.
Salties at bottom...\n\nwhat happens here I am not certain
From the console calling the attribute returns a proper string
uc.main_text
[...] \r\n\r\n [...]
How can this be transposed for use by the javascript?
\r\n\r\nis needed in the rendered javascript, not carriage returns.<%= j (uc.main_text) %>