javascript line break
i have some variables that are loaded from mysql - in mysql, the line breaks are not indicated by '\n' or '<br>' or anything -they are just line breaks.
the variable is loaded into javascript and then inserted into a <pre> element. the line breaks are not showing up.
pre1 = pre1.replace(/>/g,">"); - this works well, naturally. but how do i get those line breaks to show up as line breaks in a browser?
i've tried many variations of something like
pre1 = pre1.replace(/\\n/g,"<br>");
|