thinkphp---ajax实现删除
1 $(document).ready(function(){ 2 $("a[data]").click(function(){ 3 var data = $(this).attr('data'); 4 $.ajax({ 5 url:"{:U('Index/article_delete')}", 6 data:"article_id="+data, 7 type:'post', 8 cache:false, 9 beforeSend:function(){ 10 return confirm("确定删除?"); 11 }, 12 success:function(){ 13 window.location.reload(); 14 } 15 }); 16 }) 17 })