I do the Ajax request like this:
$("document").ready(function() { $(".js-ajax-php-json").submit(function() { var data = { "action": "test" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "POST", dataType: "json", url: "response.php", //Relative or absolute path to response.php file data: data, success: function(data) { $(".the-return").html( "Favorite beverage: " + data["favorite_beverage"] + "<br />Favorite restaurant: " + data["favorite_restaurant"] + "<br />Gender: " + data["gender"] + "<br />" + data["some"] + "<br />JSON: " + data["json"]); } }); return false; }); }); What kind of objects are var data = {"action": "test"}; and why associate them?
{}button to format the code. - AivanF.