我特林通过jQuery
到JSON
发送到PHP
页,但它不能正常工作:发送JSON到PHP
json_data = {};
json_data.my_list = new Array();
$('#table_selected tr').each (function (i) {
json_data.my_list.push ({id:$(this).attr("id")});
});
$.post ("my_page.php", json_data, function (response) {
if (response) alert("success");
else alert("error");
});
<?php
// this is my_page.php
$json = json_decode (stripslashes ($_REQUEST['my_list']), true);
echo var_dump($json);
?>
这将返回NULL
我callback
,在那里我错了?