Код: Выделить всё
$.ajax(
{
url:'ADMPANEL_POST.php',
type:'POST',
data:{'z':'1'},
dataType:'json',
success:function (result) {
alert( "Data recieved: " + result.x );
$('#result').append(result.x);
}
});
Код: Выделить всё
if(isset($_POST['z']))
{
$init_x = 'test';
$data_str[] = array('x' => $init_x);
if($_POST['z']=='1') {
echo json_encode($data_str, true);
}
}
Подробнее здесь: https://stackoverflow.com/questions/155 ... -undefined
Мобильная версия