Javascript: replacing newlines with <br/> working in FF and SAFARI and not working in IE
- by Daniel
I was thinking that replacing \n with with javascript was quite a simple task, but it seems not to be so. Posts in Ask Ben or StackOverflow suggest that something as simple as:
dst= dst.replace (/\n/g, "<br/>");
$("div.descr").html(dst);
will get the job done. Indeed, this work in FF and Safari but not in IE.
Text has been created in a textarea and then stored in a database, then retrieved without further processing. It works using FF on windows and Safari on Mac. IE on windows, nada. Is it a major bug in my head? Is it a JQuery issue?
Have some idea about how to solve this? And possible reason for?
Many thanks