环境

  • 前端Layui
  • 后端Thinkphp5

js代码

<script>
layui.use(['form', 'table'], function () {
	table.on('tool(currentTableFilter)', function (obj) {
	var data = obj.data;
            if (obj.event === 'delete') {
	    layer.confirm('真的删除行么', function (index) {
            obj.del();
            layer.close(index);
            var student_id = JSON.stringify(obj.data.id);
            window.location = "index.php?s=index/index/index&student_id=" + student_id;
            });
        }
    });
});
</script>

php代码

public function index()
{
    // $student_id = $_REQUEST['student_id'];
    $student_id = Request::instance()->get('student_id');
    echo $student_id;
}

使用GET方法传参,相较于POST,

  • 请求更快
  • GET传输的数据在 URL 中对所有人都是可见的
  • 有长度限制(URL 的最大长度是 2048 个字符)
  • ......

相关文章:

  • 2022-01-06
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案