解析参数
function parseUrlParams(query){ var re = /([^&=]+)=?([^&]*)/g, decodeRE = /\+/g, decode = function (str) { return decodeURIComponent( str.replace(decodeRE, " ") ); }; var params = {}, e; while ( e = re.exec(query) ) params[ decode(e[1]) ] = decode( e[2] ); return params; }