//获取URL参数function getQueryString(name) { var reg = new RegExp("(^|/?|&)" + name + "=([^&]*)(&|$)", "i"); var r = decodeURIComponent(location.href).substr(1).match(reg); if (r != null) return r[2]; return null;}