Jump to content

responseText returns no value in IE


SumWon

Recommended Posts

Hi,

I'm currently working on a multiplayer javascript game, and everything works great. You can move around, chat, etc, but when played using Internet Explorer, responseText is always blank. It doesn't receive a single response from the server for some reason.

 

Here's my code:

 

function login(xmlCon) {
xmlCon.onreadystatechange=function()
{
	if(xmlCon.readyState==4)
	{
		var res=xmlCon.responseText;
		var msg = res.split("|");
		plrx = msg[2];
		plry = msg[3];
	}
}
xmlCon.open("GET","scripts/conHandler.php?a=login,true);
xmlCon.send(null);
}

 

I call login and pass an XMLHttpRequest object to it, it contacts the server to login and the server responds with a set of numbers seperated by the "|" character, such as "1|43|243". Everything works fine in all browsers but IE, in which responseText is blank.

 

Anyone got any idea why?  :confused:

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/176497-responsetext-returns-no-value-in-ie/
Share on other sites

  • 2 weeks later...

Sorry for the late response. My actual code has the quote, I just edited it a bit for my post and accidentally forgot to add that ending quote...

 

The only edit I did was remove a variable from the url. I think it was "&id="+plrID

Alright, I found the problem.

 

I was using a function that created an xml request object and returned it, so like "var xmlObject = createXMLRequest();" and then I would call my login function as "login(xmlObject);" which worked find in FireFox, Chrome, Opera, etc, however did NOT in IE. I changed it so now my login function creates it's own object within itself, rather than using one that it is called with and that works fine across all browsers. Which sucks, because I liked the idea I had before...Stupid IE >.>...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.