function getUrlParam(name){ const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') const result = window.location.search.substr(1).match(reg) return result ? decodeURIComponent(result[2]) : null }