Break Line with JS
Hi,
I use cfset to set a message with several lines using "\n" in CFC. For example:
<cfset message = message & #JSStringFormat(namelist.name)# & '\n'>
Then, when I use alert('#message#') in CFC, it shows the message with several lines correctly.
Then, I use:
document.getElementById('nameList').innerHTML = '#message#';
to return the name list to CFM page.
However, when I use alert(document.getElementById('nameList').innerHTML) in CFM, it shows message incorrectly. it only shows me all name with a delimiter " ".
It seems the line break character "\n" cannot work correctly. Can anyone help me to solve this problem?
