Response.text in Mozilla returns null / undefined

Discussion in 'Javascript' started by Anat, May 19, 2006.

  1. Anat

    Anat Guest

    Hi,

    When I use the following function

    function SyncHTTPRequest(strURLWithParams)
    {
    var oXMLHttp;
    // code for Mozilla, etc.
    if (window.XMLHttpRequest)
    {
    oXMLHttp = new XMLHttpRequest()
    }
    // code for IE
    else if (window.ActiveXObject)
    {
    oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP")
    }

    if (oXMLHttp)
    {
    oXMLHttp.open("GET",strURLWithParams,false)
    oXMLHttp.send("a")
    }
    return oXMLHttp.ResponseText;
    }

    the oXMLHttp.ResponseText returned in Mozilla is always NULL or
    undefined, whereas in IE it works fine.

    Am I missing something?

    Thanks, Anat.
     
    Anat, May 19, 2006
    #1
    1. Advertising

  2. Anat

    Ian Collins Guest

    Anat wrote:
    > return oXMLHttp.ResponseText;
    > }
    >
    > the oXMLHttp.ResponseText returned in Mozilla is always NULL or
    > undefined, whereas in IE it works fine.
    >

    Hardly surprising, considering XMLHttpRequest doesn't have a
    ResponseText attribute. It does have responseText.

    --
    Ian Collins.
     
    Ian Collins, May 19, 2006
    #2
    1. Advertising

  3. Anat

    Anat Guest

    Oops...
    Thanks!!!! Learn something new every day... :)
    It's the second time you've helped me. Thanks again!!!
     
    Anat, May 19, 2006
    #3
  4. Anat

    Ian Collins Guest

    Anat wrote:
    > Oops...
    > Thanks!!!! Learn something new every day... :)
    > It's the second time you've helped me. Thanks again!!!
    >

    One more tip: read <http://cfaj.freeshell.org/google/>

    Cheers,

    --
    Ian Collins.
     
    Ian Collins, May 19, 2006
    #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. vizlab
    Replies:
    3
    Views:
    4,213
    Michael Bar-Sinai
    Oct 17, 2007
  2. Replies:
    5
    Views:
    26,694
    Mike Schilling
    Mar 29, 2006
  3. Col
    Replies:
    1
    Views:
    628
    peter koch
    Apr 21, 2006
  4. mike
    Replies:
    1
    Views:
    201
    Aaron [SQL Server MVP]
    Sep 16, 2004
  5. Don Vaillancourt

    First "undefined" then null and now "null"

    Don Vaillancourt, Oct 27, 2004, in forum: Javascript
    Replies:
    13
    Views:
    214
    Thomas 'PointedEars' Lahn
    Dec 11, 2004
Loading...

Share This Page