Cannot get a simple html file from an http address

X

xcampanoli

When I uncomment either of the http urls below instead of the local
file, I always get a readyStatus of zero, and I never get past trace 2
alert. When I use the local file I get readyStatus 1 and get to trace
3 just fine:

alert("xhr = " + xhr);
xhr.onreadystatechange = parseHttpResponse;
alert("trace 1:" + xhr.status + ", readyState: " +
xhr.readyState);
try {
//xhr.open("GET", "http://www.eskimo.com", true);
//xhr.open("GET", "http://joehill/index.html", true);
xhr.open("GET", "file:///home/xeno/study/read000.html",
true);
} catch(e) {
alert("trace 1a:" + xhr.status + ", readyState: " +
xhr.readyState);
};
alert("trace 2:" + xhr.status + ", readyState: " +
xhr.readyState);
xhr.send(null);
alert("trace 3:" + xhr.status + ", readyState: " +
xhr.readyState);
----snip----
I think I'm supposed to be able to do this, but as I say above it
doesn't go. I wonder if there's an extra setting here I missed, or if
I need to specify a UserAgent or configure my web server daemon
somehow differently. Please I am stuck. I need feedback or
especially references.
 
M

MadMad

When I uncomment either of the http urls below instead of the local
file, I always get a readyStatus of zero, and I never get past trace 2
alert. When I use the local file I get readyStatus 1 and get to trace
3 just fine:

alert("xhr = " + xhr);
xhr.onreadystatechange = parseHttpResponse;
alert("trace 1:" + xhr.status + ", readyState: " +
xhr.readyState);
try {
//xhr.open("GET", "http://www.eskimo.com", true);
//xhr.open("GET", "http://joehill/index.html", true);
xhr.open("GET", "file:///home/xeno/study/read000.html",
true);
} catch(e) {
alert("trace 1a:" + xhr.status + ", readyState: " +
xhr.readyState);
};
alert("trace 2:" + xhr.status + ", readyState: " +
xhr.readyState);
xhr.send(null);
alert("trace 3:" + xhr.status + ", readyState: " +
xhr.readyState);
----snip----
I think I'm supposed to be able to do this, but as I say above it
doesn't go. I wonder if there's an extra setting here I missed, or if
I need to specify a UserAgent or configure my web server daemon
somehow differently. Please I am stuck. I need feedback or
especially references.

i think you should attach url joker param for example homepage.html
but now homepage.html?random=3432432.3243 to make it recover again the
web page...

i hope it can help you....
 
X

xcampanoli

I made the following additions, but my results are the same. It
appears I have no way to talk to other than my own server. Is this
always just limited to my native server? If so I don't get some of
the examples I'm seeing...??xhr.open("GET", "http://joehill/index.html?
joker=9999999", true);
//xhr.open("GET", "file:///home/xeno/study/read000.html",
i think you should attach url joker param for example homepage.html
but now homepage.html?random=3432432.3243 to make it recover again the
web page...

I appreciate your feedback, but I think my problem is something else,
or at least includes something else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top