前后端分离前端互相传参:
A传B:
A网页:
window.location.href='xxx.html?id='+value
//xxx.html是你想跳转的网页 value就是你想传的id
B网页:
url = document.location.href;//获取当前url:xxx.html?id=value
value = url.toString().split('?')[1].split('=')[1];//获的value的值
前后端分离前端互相传参:
A传B:
A网页:
window.location.href='xxx.html?id='+value
//xxx.html是你想跳转的网页 value就是你想传的id
B网页:
url = document.location.href;//获取当前url:xxx.html?id=value
value = url.toString().split('?')[1].split('=')[1];//获的value的值