文本框换行转译
data.indexOf('\\n') != '-1'
data.replace(/\\n/g,"\r"),
else
data.replace(/\\r/g,"/r")
html换行转译
data.indexOf('\\n') != '-1'
data.replace(/\\n/g,"<br/>")
else
data.replace(/\\r/g,"<br/>")
标签:换行,indexOf,replace,输入框,转译,else,data
来源: https://www.cnblogs.com/lishuang2243/p/15874822.html