weixin_33725272 2015-11-22 15:07 采纳率: 0%
浏览 18

jQuery .post数据不显示

HTML

<input type='button' class='btn btn-success update' value='Update' name='update' >

JavaScript

$(document).ready(function(){
            var id;
            var car_Name;
            var updateThis="update";

            $(".update").on('click', function () {
                $.post("process.php",{id:$(".car_name").attr('rel'),car_name:$(".car_name").val(),updateThis:updateThis},function(data){
                    alert(data);
                });
            });
        });

PHP

if(isset($_POST['updateThis']))
{
    echo $_POST['id']." ".$_POST['car_name'];
}

I'm sending data to "process.php" page. I ca not understand about 3rd data "updateThis:updateThis" without this it can not show data.

  • 写回答

1条回答 默认 最新

  • H_MZ 2015-11-22 15:26
    关注

    What is your php code? I believe you check $_POST['updateThis'] in your PHP code and if not set don't show response.

    评论

报告相同问题?