Javascript 如何在jquery中附加带有脚本变量的php?

Javascript 如何在jquery中附加带有脚本变量的php?,javascript,jquery,laravel,Javascript,Jquery,Laravel,我想附加php代码,我想在我的php代码中使用脚本变量。 我该怎么做 函数sendajax(id、状态、计数){ $.ajax({ url:{{url(“admin/loadmoredata”)}}, 方法:“张贴”, 数据:{id:id,status:status,count:count,{u令牌:{{csrf\u令牌()}}}, 数据类型:“json”, 成功:功能(数据) { 如果(状态=1) { 如果(数据[0]==400){ $('.acceptorder btn').html('无数

我想附加php代码,我想在我的php代码中使用脚本变量。 我该怎么做

函数sendajax(id、状态、计数){ $.ajax({ url:{{url(“admin/loadmoredata”)}}, 方法:“张贴”, 数据:{id:id,status:status,count:count,{u令牌:{{csrf\u令牌()}}}, 数据类型:“json”, 成功:功能(数据) { 如果(状态=1) { 如果(数据[0]==400){ $('.acceptorder btn').html('无数据'); }否则{ console.log(数据[2]) var行=数据[1]; $.each(数据[2],函数(索引,值){ 行++ $('.load').append(`+row+`+value[“receiver_name”]+`); $('#btn more').removeAttr('data-id'); $('.loadmore btn').attr('data-id',value['id']); }); } //$('.load')。追加(数据); } 其他的 { $(“#btn more”).html(“无数据”); } } }); } }); 我可以像这样显示脚本变量
echo'+value[“id”]+'

但是我不能在php中使用这个变量,当我
dd()
variable时,它返回null。

你想做什么?我想最好解释一下,也许你走错了路!我不明白,为什么要用php变量呢!你想做什么?我想最好解释一下,也许你走错了路!我不明白,为什么要用php变量呢!