|
@@ -35,11 +35,10 @@ function addNewStyle(newStyle) {
|
|
styleElement.appendChild(document.createTextNode(newStyle));
|
|
styleElement.appendChild(document.createTextNode(newStyle));
|
|
}
|
|
}
|
|
|
|
|
|
-//直接读取浏览器url
|
|
|
|
-function GetQueryString(name) {
|
|
|
|
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
|
- var r = location.href.substring(location.href.indexOf('?') + 1).match(reg); //获取url中"?"符后的字符串并正则匹配
|
|
|
|
- var context = "";
|
|
|
|
|
|
+function getQueryStringByUrl(url, name) {
|
|
|
|
+ let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
|
+ let r = url.substring(url.indexOf('?') + 1).match(reg); //获取url中"?"符后的字符串并正则匹配
|
|
|
|
+ let context = "";
|
|
if (r != null)
|
|
if (r != null)
|
|
context = r[2];
|
|
context = r[2];
|
|
reg = null;
|
|
reg = null;
|
|
@@ -47,6 +46,12 @@ function GetQueryString(name) {
|
|
return context == null || context === "" || context === "undefined" ? "" : decodeURI(context);
|
|
return context == null || context === "" || context === "undefined" ? "" : decodeURI(context);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//直接读取浏览器url
|
|
|
|
+function getQueryString(name) {
|
|
|
|
+ return getQueryStringByUrl(location.href, name);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
function getRandomInt(min, max) {
|
|
function getRandomInt(min, max) {
|
|
min = Math.ceil(min);
|
|
min = Math.ceil(min);
|
|
max = Math.floor(max);
|
|
max = Math.floor(max);
|