I have a txt file that i can read using an onclick event, but it shows the text file all one one page in html, how can i get it to read each line?
text file:
name: karen | wendy
Age: 32 | 31
javascript:
function your_name()
{
var details = document.getElementById('details');
var url = "customers.txt";
ajax.open("GET", url);
ajax.onreadystatechange = function()
{
if (ajax.readyState == 200)
details.innerHTML =reply.responseText.split("\|");
}
works fine, but reads text file on one line? tried using \n and still wont work,
any ideas?
2007-12-02
08:15:28
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design