Pass the url parameters from page one to page two:
window.location.href="./page2.html?content="+encodeURI(encodeURI(userText))+"&name="+encodeURI(encodeURI(name));
var rf = document.referrer; //获取url参数 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } var name = decodeURI(getQueryString('name')); var content = decodeURI(getQueryString('content'));
My personal blog: http://blog.caicongyang.com;
My personal website: http://www.caicongyang.com;
My CSDN blog address: