Cannot get a simple html file from an http address

Discussion in 'Javascript' started by xcampanoli@gmail.com, Jul 3, 2007.

  1. Guest

    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.
     
    , Jul 3, 2007
    #1
    1. Advertising

  2. MadMad Guest

    On 2 jul, 21:11, "" <> wrote:
    > 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....
     
    MadMad, Jul 3, 2007
    #2
    1. Advertising

  3. Guest

    On Jul 2, 11:06 pm, MadMad <> wrote:
    > On 2 jul, 21:11, "" <> wrote:
    >

    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...??
    >
    >
    > > 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.abort();
    > > 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?
    joker=9999999", 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 appreciate your feedback, but I think my problem is something else,
    or at least includes something else.

    >
    > i hope it can help you....
     
    , Jul 5, 2007
    #3
  4. MadMad Guest

    have you tried to find some examples in: http://www.w3schools.com/ajax/default.asp

    On 5 jul, 16:17, "" <> wrote:
    > On Jul 2, 11:06 pm, MadMad <> wrote:> On 2 jul, 21:11, "" <> wrote:
    >
    > 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...??
    >
    > > > 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.abort();> > 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?
    > joker=9999999", 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 appreciate your feedback, but I think my problem is something else,
    > or at least includes something else.
    >
    >
    >
    > > i hope it can help you....
     
    MadMad, Jul 10, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    1,060
  2. Replies:
    3
    Views:
    462
    Christopher
    Feb 2, 2008
  3. DanielJohnson

    cannot get the right address/pointer

    DanielJohnson, Oct 7, 2008, in forum: C Programming
    Replies:
    4
    Views:
    322
    Nick Keighley
    Oct 8, 2008
  4. C Jones
    Replies:
    0
    Views:
    351
    C Jones
    Jul 10, 2003
  5. Wladimir Borsov
    Replies:
    4
    Views:
    324
    Tintin
    May 11, 2006
Loading...

Share This Page