PDA

View Full Version : Resolved AJAX form passing viables through send()



crobinson42
04-08-2012, 09:26 PM
HELP!

My ajax form works but it doesn't...


var testVariable="testVar=test";

xmlhttp.open("POST","new_msg_save.php",true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(testVariable);

^ does not work... but



xmlhttp.open("POST","new_msg_save.php",true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send("testVar=test");

^ DOES work... what am i missing?