1
$("#delete").click(function() {
    deleterecord();
});

function deleterecord(){
    var id = $("#iduser").val();
    alert("aw"+id);
    var id     = $('#iduser').attr();   
    e.preventDefault();
    pressed = "delete"  

    $.ajax({
        type: "post",
        url: "IngSave.php",
        data: "&idshit="+ id,
        data: "&gagawin="+ pressed,
        success: function(){
            alert("ATTENTION");
            $("#usertbl").html(data);
        }
    });
    return false;
}

我没有得到变量 $_POST['idshit'];和 文件$_POST['gagawin'];IngSave.php

4

2 回答 2

2

尝试这个:

$.ajax({
    type: "post",
    url: "IngSave.php",
    data: {idshit:id,gagawin:pressed},
    success: function(){
        alert("bitch");
        $("#usertbl").html(data);
    }
});
于 2013-09-29T00:24:35.297 回答
2

您的通话中有两个data参数不正确,请将ajax其更改为

$.ajax({
    type: "post",
    url: "IngSave.php",
    data: "idshit="+id+"&gagawin="+pressed, // or - { idshit:id,gagawin:pressed }
    success: function(){
        alert("bitch");
        $("#usertbl").html(data);
    }
});
于 2013-09-29T00:24:37.447 回答