SumWon Posted October 5, 2009 Share Posted October 5, 2009 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? Thanks. Quote Link to comment Share on other sites More sharing options...
corbin Posted October 6, 2009 Share Posted October 6, 2009 xmlCon.open("GET","scripts/conHandler.php?a=login,true); Could be that you're missing the closing quote: xmlCon.open("GET","scripts/conHandler.php?a=login",true); Quote Link to comment Share on other sites More sharing options...
SumWon Posted October 20, 2009 Author Share Posted October 20, 2009 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 Quote Link to comment Share on other sites More sharing options...
SumWon Posted October 25, 2009 Author Share Posted October 25, 2009 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 >.>... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.