I do not get this issue myself:
$('<textarea>').load('./styles/style.css').appendTo('body');
I insert that into the page:
http://www.balupton.com/sandbox/jquery-sparkle/demo/
And it displays as expected.
The issue probably lays with the line endings used. The web uses "\n"
while some versions of mac use "\r"
, and windows uses "\r\n"
.
Or if you are trying to display it in a DIV
, you will have to use the CSS white-space: pre;
to show the line spaces without converting them into BR
s.
Edit: forgot the dash in white-space.