jQuery load function stripping out end-of-line characters
I'm having a problem on random IE8 and IE9 browsers when I call the load function on the below html page. It's supposed to simply load the contents of the text file gAddress.txt into the textarea. But for some reason on some IE8 and IE9 browsers, it strips out the end-of-line characters so the text:
a
b
c
d
loads instead like:
a b c d
I'm running IE10 on my computer and the process works fine and I've actually found one computer running IE8 where it works (which baffles me even more). I have not been able to find anything about this online. Any help would be appreciated. On one problem computer running IE8, I try the same html page in Chrome and it works correctly.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JQuery Text File Load Test</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#loadfile").click(function(){
$("#textarea1").load('gAddress.txt');
});
});
</script>
</head>
<body>
<button id="loadfile">Load textarea from file</button>
<div>Text should appear in text box below when "Load File" button is pushed</div>
<textarea rows="30" cols="80" id="textarea1" wrap="soft"></textarea><br/>
</body>
</html>