function getUrlParam(sUrl, sKey) { let arr = sUrl.split("?")[1].split("#")[0].split("&"), obj={}; arr.forEach(item=>{ let [key, value] = item.split("="); if(key in obj){ obj[key] = [].concat(obj[key], value); }else{ obj[key] = value } }) return sKey ? obj[sKey] || "" : obj; }