标签:item arch ret turn log split ++ test class
兼容不带参数等情况
function getUrlParam(){ var params = {}; var search = location.search; search = /\?/.test(search) && search.split("?")[1]; var searchs = /\&/.test(search) ? search.split("&") : [search]; for(var i = 0 ; i < searchs.length ; i++){ if(/\=/.test(searchs[i])){ var item = searchs[i].split("="); params[item[0]] = item[1]; }; }; return params; };
标签:item arch ret turn log split ++ test class
原文地址:http://www.cnblogs.com/wangxiaohang/p/7646781.html