我尝试从ajax发送一些数据到我的php文件,但我无法成功。 这是我的ajax文件,为什么我无法获得ajax值?
var artistIds = new Array();
$(".p16 input:checked").each(function(){
artistIds.push($(this).attr('id'));
});
$.post('/json/crewonly/deleteDataAjax2',artistIds,function(response){
if(response == 'ok')
alert('error');
else
alert('nop');
})
,并在PHP端我用这个代码
extract($_POST);
if(isset($artistIds))
$this->sendJSONResponse('ok');
else
$this->sendJSONResponse('error');
$ artistIds总是与空 为什么为什么为什么
最后我来到了这一点,但也不起作用
var artistIds = new Array();
$(".p16 input:checked").each(function(){
artistIds.push($(this).attr('id'));
});
$.post('/json/crewonly/deleteDataAjax2', { artistIds: artistIds },function(response){
if(response == 'ok')
alert('dolu');
elseif (response == 'error')
alert('bos');
});*
SRY ......监督你的提取物() – 2012-03-23 17:58:32
$ artistIds是一个数组是的,但它是空的 – user1277467 2012-03-23 17:59:52
叶氏其empyt在PHP端,为什么:S – user1277467 2012-03-23 18:00:40