1、在1.html传参
<a href="2.html?name=姓名&password='123abc'">跳转</a>
2、在2.html获取传递的参数
var name=getQueryString('name');
var password=getQueryString('password');
console.log(name); //姓名
console.log(password); //123abc
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = decodeURI(window.location.search).substr(1).match(reg);
if(r != null) return (r[2]);
return null;
}