1 // ajax操作 2 $('#btn').on('click',function(){ 3 var url = "{:url('confirm')}"; 4 var actual_money=$('.input').val() 5 var id = "{$id}"; 6 $.post( 7 url, 8 {actual_money:actual_money,id:id}, 9 function (index) {10 if(index.code==1){11 layer.msg('操作成功', {time: 1000,icon: 6});12 window.setTimeout("parent.location.reload()", 1100);13 }else{14 alert('操作失败!');15 }16 }17 )18 19 })