Fork me on GitHub

执行ajax成功后进行页面的刷新

location.reload(true);

window.location.reload();

<script src="/include/static/js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
  $("#train").on("click",function(){
    var id = $("#id_res").val();
    var is_ok = $("#is_ok").val();
    var type = 'caiji_train';
  //异步获取信息
    var url = '__URL__/caiji_train';
    var data = {type:type,is_ok:is_ok,id:id};
    $.ajax({
      url:url,
      data:data,
      dataType:'json',
      type:"POST",
      success:function(data){
         if(data.code==1){
          alert(data.msg);
          $('#train').text('已审核');
          location.reload(true);
        }
        if(data.code==0){
          alert(data.msg);
          $('#train').text('未审核');
        }  
      }
    })
  })
</script>