Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Response.text in Mozilla returns null / undefined

Reply
Thread Tools

Response.text in Mozilla returns null / undefined

 
 
Anat
Guest
Posts: n/a
 
      05-19-2006
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.

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      05-19-2006
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.
 
Reply With Quote
 
 
 
 
Anat
Guest
Posts: n/a
 
      05-19-2006
Oops...
Thanks!!!! Learn something new every day...
It's the second time you've helped me. Thanks again!!!

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      05-19-2006
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
Begin() applied on empty Vector returns NULL or non null value???? Col C++ 1 04-21-2006 01:12 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
First "undefined" then null and now "null" Don Vaillancourt Javascript 13 12-11-2004 04:24 PM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM



Advertisments