数据在 $.ajax jquery 中无法正常工作


data not worked properly in $.ajax jquery

这个脚本无法正常工作是什么问题?

$(".clik_for_fetch").click(function(){
  var request="id="+$(this).attr("fetch_id");
  $.ajax({
            url:"pro/userlist.php",
            data:request,
            dataType:"html",
            type:'POST', 
            data:JSON.stringify(request),
            beforeSend: function(){
            },
            success:function(result){
                  $(".table-striped tbody").html(result);
             },
            complete: function(){
            }
    });
});

和页数

while($total_rows > 0)
                {
                    echo '<li><a href="#" class="clik_for_fetch" fetch_id="'.$i.'">'.$i.'</a></li>';
                    $i++;
                    $total_rows--;
                }

var_dump($_POST) 的结果是

array (size=1)
  '"id' => string '1"' (length=2)

我做错了什么?

试试这个语法

<script>
$(document).ready(function(){
    $(".clik_for_fetch").click(function(){
  var data ={
      id : $(this).attr("fetch_id")
  }
  $.ajax({
            url:"cp.php",
            data:data,
            dataType:"html",
            type:'POST', 
            beforeSend: function(){
            },
            success:function(result){
                  $(".table-striped tbody").html(result);
             },
            complete: function(){
            }
    });
});
});

</script>