If you want to load a file form the server you can use the XMLHttpRequest object and get the responseText or responseXML, depending on the format of the data.
var fileArray = string.split('\n')
You'll want to use the 'For Netscape 6' one from that page, the other two use techniques that have been superseded and do not work on all browsers.
a JS function which does what the PHP function file() does. I want to read a file to a string or array.