I am trying to send 2 variables in a JQuery Ajax call, but for some reason, both variables end up bundled in the first one:
function getNextQuestion(answer, queryType)
{
$.ajax
({
async: false,
url: 'handlers/question_hdlr.php',
type: 'POST',
data: "answer="+ answer +"&queryType=" + queryType,
dataType: "json",
success: function(result)
{
...
},error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert ("error: "+textStatus);
}
});
return false;
}
When I run it in the debugger, I get only one variable:
$_POST["answer"], containing "answerqueryTypequeryType"
$_POST["queryType"] does not exist.
What am I doing wrong?