Welcome Guest, Not a member yet? Register   Sign In
problems with ajax
#5

[eluser]Randy Casburn[/eluser]
Sorry, Forgot to mention when you use the raw methods like this that the parameters must be sent specifically with the POST. Like so:

Code:
var parameters = "username=<?=$whatever_goes_here?>";
  xmlhttp.onreadystatechange=state_Change;
  xmlhttp.open("POST",url,true);
  xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlhttp.setRequestHeader("Content-length", parameters.length);
  xmlhttp.setRequestHeader("Connection", "close");
  xmlhttp.send(parameters );

Note the way you construct your parameters is different here.

The headers must be sent, the parameter length is required, and the parameters must be put into the send method of the xmlhttp obj.

Should have mentioned that above. This is why we all use the JS frameworks. They obscure all the 'rawness'.

Try that and it should work.


Messages In This Thread
problems with ajax - by El Forum - 09-01-2008, 04:59 PM
problems with ajax - by El Forum - 09-01-2008, 05:43 PM
problems with ajax - by El Forum - 09-01-2008, 05:47 PM
problems with ajax - by El Forum - 09-01-2008, 06:20 PM
problems with ajax - by El Forum - 09-01-2008, 07:01 PM
problems with ajax - by El Forum - 09-01-2008, 08:04 PM
problems with ajax - by El Forum - 09-01-2008, 08:18 PM
problems with ajax - by El Forum - 09-01-2008, 08:22 PM
problems with ajax - by El Forum - 09-01-2008, 09:04 PM
problems with ajax - by El Forum - 09-01-2008, 09:18 PM
problems with ajax - by El Forum - 06-14-2010, 06:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB