$('.editBtn').click(function(){//EDIT BUTTON EVENT
$.getJSON('edit.php?url='+encodeURI($(this).siblings('a').attr('id'))+'&action=edit',function(data){
$.each(data, function(key, val) {
alert(key+': '+val);
});
});
});//EDIT BUTTON END
и вот часть php:
elseif($_GET['action']=='edit'){
$output=$mysql->getDb()->query("select * from video
where url='{$_GET['url']}'")->fetchAll();
header("content-type: application/json");
echo json_encode($output[0]);
}
что происходит, когда при нажатии кнопки .editBtn
появляется предупреждение о кнопке 0:value0, 1:value1,...
, а затем снова, но я хочу, чтобы оно было name0:value0, name1:value1,...
что происходит?
p.s. PHP работает независимо:
{"url":"www.vimeo.com\/20721308","0":"www.vimeo.com\/20721308","title":"Dis-patch Festival R.I.P.","1":"Dis-patch Festival R.I.P.","description":"Sadly, the last goodbyes to the Dis-patch Festival Belgrade edition in this tribute \"R.I.P.\" video collage. The end is always the beginning...","2":"Sadly, the last goodbyes to the Dis-patch Festival Belgrade edition in this tribute \"R.I.P.\" video collage. The end is always the beginning...","country":"serbia","3":"serbia","postDate":"2011-05-07 05:56:04","4":"2011-05-07 05:56:04","views":null,"5":null}