The goal
Send [{"ID": 1, "Name": "XBOX"}, {"ID": 2, "Name": "Playstation 3"}] via $.ajax() using jQuery.
The problem
I have this:
[...]
var object = $.parseJSON(data);
$.ajax({
type: "POST",
url: "laboratory.php",
data: object,
success: function(response) {
console.log(response);
}
});
And, in laboratory.php:
<?php print_r($_REQUEST); ?>
And finally, the return via console is:
Array
(
[undefined] =>
)
This is what the data's variable means:
[{"ID": 1, "Name": "XBOX"}, {"ID": 2, "Name": "Playstation 3"}]
And this is what object means (by Chrome's console):
[Object, Object]
Can someone give me an idea?
print_r($_POST);? If yes, then I already did and the return is the same.