Hi guys!
Please, be gentle to me! I’m just trying to get into jQuery…
My first try is to read a text file and put information read on the page.
I found, modified a little and used this code:
<script>
$.get('Files/Address.txt', function(textData, status) {
var aLines = textData.split("\n")
alert(textData + '\nStatus = ' + status); // this works, all lines
from the file are displayed
$.each(aLines, function(n, sLine) {
$('#textFromFile').append('<div>' + sLine + '</div>'); // ?????
alert(n + ' - ' + aLines[n]); // this also work
});
alert("File read OK");
}, 'text');
</script>
From the example I found, I left the line “$('#textFromFile').append('<div>' + sLine + '</div>');”, but have no idea what it is for.
Can you, please, try to explain it to me and tell how it can be used?
Also: how can I pass aLines[n] to the page?
Thank you in advance!
Tom