我为jquery变量分配了id值但是没有从jquery获取ajax。如何找到正确的解决方案,
这是我的代码,
$(function(){
$('.delme').click(function(){
/* if($('#pwd').val() == 'admin'){
}else{
alert('failure');
}*/
var del_id= $('.del').attr('id'); //var $ele = $(this).parent().parent();
$.ajax({
type:'POST',
url:'delete1.php',
data:{'del_id':del_id},
success: function(data){
if(data==0){
$ele.fadeOut().remove();
alert("Successfully deleted");
}else if(data==1){
alert("can't delete the row")
}
}
});
});
});
</script>