uisng the javascript for reading a text file from a website

apollonarius's icon

Using the readline method in JS: I am able to get the readline function to pars an integer out of a text file locally. as in the code below.

Can this be use to point to a text file in a website, such as "filename = "/http://www.domain.com/folder/text/test.txt";" So far I only get a "undefined" result for the vars, in the attempt to read the text file in a webserver.

function bang(){
    // filename = "/c:maxtestfile/test.txt";
    filename = "/http://www.domain.com/folder/text/test.txt";
    access = "readwrite";
    typelist = new Array("iLaF" , "maxb" , "NUMBER" );
    f = new File(filename, access, typelist);

    while(f.isopen && f.position < f.eof ){
        x = parseInt(f.readline(1) + "\n");
        y = (x*.142)+3.01;
        j = 14;
    }
    post("the num in file is");
    post(x);
    post();
    f.close();
}