admin 发表于 2018-8-28 17:07:53

js 写入cookie和js接收thinkphp数据

document.cookie="remark="+remark+";expires="+60000+";path=/";

js接收thinkphp数据

var url="{:U('Car/addOrder',array('address_id'=>$addinfp['address_id'],'remark'=>'urlremark'))}";
var urls=url.replace("urlremark",remark);
location.href = urls;
先用文本吧U方法带入js然后用is替换方法 将文本替换成要输出的url地址 之后用href请求地址 本方法是不用U方法直接将url写死↓
location.href = "/Shop/Car/addOrder/address_id/{$addinfp['address_id']}/remark/"+remark+".html";


页: [1]
查看完整版本: js 写入cookie和js接收thinkphp数据