_gup(name, url, encode) { if (!url) url = location.href; name = this.encrypt(name, encode); name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(url); return results === null ? null : this.decrypt(results[1], encode); }, // 取url参数,例如:gup('type', 'http://localhost:8080/demo/xxx?type=123'); gup(name, url, encode) { var result = this._gup(name, url, encode); if (result === null) { return this._gup(name, url, false); } return result; },
标签:name,url,results,js,var,gup,参数,encode From: https://www.cnblogs.com/lb0121/p/16787514.html