RIRedinPA Posted January 21, 2009 Share Posted January 21, 2009 is it possible to do this? xmlHttp.onreadystatechange=function(variable) { if(xmlHttp.readyState==4) { variable.innerHTML = xmlHttp.responseText; } } //make sure ? is in qstring, not page xmlHttp.open("GET", thepage + qstring, true); xmlHttp.send(null); Quote Link to comment Share on other sites More sharing options...
F1Fan Posted January 21, 2009 Share Posted January 21, 2009 Yes, but you don't even need to add it to the function arguments. This will work: function doStuff(variable){ var url = 'ajax.php'; http.open('GET', url, true); http.send(null); http.onreadystatechange=function(){ if(http.readyState==4){ variable.value = http.responseText; } } } Quote Link to comment Share on other sites More sharing options...
RIRedinPA Posted January 21, 2009 Author Share Posted January 21, 2009 Thanks, I had that but somehow it didn't work, I must have had another error negating it, rewrote the script and it worked like a dandy... 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.