Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XMLHTTPRequest ResponseText is blank?

55 views
Skip to first unread message

Raj Singh

unread,
Jul 8, 2009, 1:47:44 PM7/8/09
to
Hi,

For some reason, with the following snippet, I am always getting an
empty string in request.responseText (testing in FF 3.5) - any ideas?

I verified that the URI returns a value - here is a sample URI:
http://www.gamechalk.com/simulator/simulator.php?req=Simulator%20coming%20soon%21%20SMS%20Zork%20to%2041411%20to%20play.&user=100

function postCommand()
{
var uri = "http://www.gamechalk.com/simulator/simulator.php";
var cmd = document.getElementById("command").value;
var user = "100";
uri += "?req=" + escape(cmd) + "&user=" + user;

if (request != null && request.readyState != 0 &&
request.readyState != 4)
{
request.abort();
}

try
{
request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
request = false;
}
}
if (!request && typeof XMLHttpRequest != 'undefined')
{
request = new XMLHttpRequest();
}
request.open("GET", uri, true);
request.onreadystatechange = function()
{
if (request.readyState == 4)
{
alert(request.responseText);
}
};
request.send(null);
}

Thanks in advance.

Raj

high elf mage

unread,
Jul 24, 2009, 12:53:34 AM7/24/09
to
im havin the same issue though with a much simpler example....

im just trying to open an xml file, and then to read back its contents
using a simple alert box...and the reponseText property within the
parentheses..

alert(xob.responseText);

not getting any data, an empty alert pops up..thats it...

did you have any luck with this?
do lemme know..

On Jul 8, 10:47 pm, Raj Singh <rsing...@yahoo.com> wrote:
> Hi,
>
> For some reason, with the following snippet, I am always getting an
> empty string in request.responseText (testing in FF 3.5) - any ideas?
>

> I verified that the URI returns a value - here is a sample URI:http://www.gamechalk.com/simulator/simulator.php?req=Simulator%20comi...

0 new messages