I try to post an JS object to PHP, but the PHP says nothing.. It looks like it don't recognize the POST...
Here is the JS :
$('.send').click(function() {
var Scommand = JSON.stringify(command);// Command is my JS obj
if (commande.type) {
$.ajax({
url:'test.php',
context:$(this),
type:'POST',
data:Scommande,
success : function(data){
commande = {};
window.location='test.php';
}
});//End Ajax
}
else {'PLz specify a type');}
});
And my PHP :
<?php
echo $_POST['type'];
?>
It returns : Notice: Undefined index: type in /Applications/MAMP/htdocs/BackOfficeDavid/test.php on line 2
Like nothing go throw the POST ... Any clue ?