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
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

Link to comment
Share on other sites

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 >.>...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.