0

I have the following code on my web site:

    var fileUrl = constants.homeTextUrl;

    var rawFile = new XMLHttpRequest();

    rawFile.open("GET", fileUrl, true);

    rawFile.onreadystatechange = function () {
        if (rawFile.readyState === 4) {
            if (rawFile.status === 200 || rawFile.status === 0) {
                var text = rawFile.responseText;
                process(text); // text is null here unless local file
            }
        }
    };

    rawFile.send(null);

When constants.homeTextUrl points to a local file on the same web server, all is well. But when it is "http://members.ozemail.com.au/~rliq/home.txt" (a valid url you can check it), then nothing is returned.

Does anyone know what the issue may be?

Rob L
  • 2,124
  • 3
  • 22
  • 50

0 Answers0