js获取hash参数值.txt function query(name) { var reg = new RegExp("(^|)" + name + "=([^]*)(|$)"); var params = window.location.hash.split('?')[1]; var r = params.match(reg); if (r != null) return unescape(r[2]); return null;}
function query(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var params = window.location.hash.split('?')[1]; var r = params.match(reg); if (r != null) return unescape(r[2]); return null; }