Using jQuery\'s .load()
method I\'m loading text into a textarea. Works fine in Chrome & FF. As always, IE just has to be different and won\'t display the l
This is probably a line-ending issue. Are the line breaks in the text \n
s or \r\n
s? If they're just \n
s try normalizing the text. You can do this with a bit of JavaScript:
function normalizeNewlines(text)
{
return text.replace(/(\r\n|\r|\n)/g, '\r\n');
}
This is a solution that's worked for me in the past when doing essentially the reverse: I needed to take text out of a that could be pasted into
!@#$ing
Notepad and show up with the line breaks intact.