/ / get parameter (browser URL) function getQueryParam (key) {var reg = new RegExp (" [? | \ \ &] "+ key +" = ([^ &] +) "); var mStrs = window.location.search.match(reg); return mStrs && decodeURIComponent(mStrs[1]); } / / get all the parameters (browser URL) function getQueryParams () {var mStrs = window. The location. The search. The match (/ /? \ \ & \ w + = (/ ^ & *)/g); var retJson = {} for (var i = 0; i < mStrs.length; i++) { retJson[mStrs[i].match(/\w+/)[0]] = decodeURIComponent(mStrs[i].split('=')[1]); } return retJson; }Copy the code