tp5传递数据到后台的方式

最常用的;

$.ajax({
    type:'post',
    url:"__CONTROLLER__/updateData",
    data:{
        'id':id,
        'is_through':is_through,
    },
    success:function ($item) {
        console.log($item);
        location.reload();
    },
    error:function ($item) {
        console.log('更新数据失败');
        alert('数据更新失败');
    }
 
 

另外一种:

location.href='__CONTROLLER__/exportTable/meeting_room/'+meeting_room+'/start_time/'+start_time+'/end_time/'+end_time;后台可以通过get获得这些数据。如:I('get.')   exportTable是方法,后面是参数和对应的数据

猜你喜欢

转载自blog.csdn.net/qq_21208843/article/details/80799350
今日推荐