var regexp = /[?&]([^=#]+)=([^&#]*)/g,params = {},check; while (check = regexp.exec(webViewState.url)) { params[check[1]] = check[2]; } console.log("params",params)