function getUrlParam(name){ const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); const query = window.location.href.split('?')[1]; if(!query) return null; const r = query.match(reg); return r ? decodeURIComponent(r[2]) : null;}