class Util { //节流throttle代码: throttle(fn,delay) { let canRun = true; // 通过闭包保存一个标记 return function () { if (!canRun) return; canRun = false; setTimeout(() => { fn.apply(this, arguments); canRun = true; }, delay); }; } footer () { var body = $("body") var currentPath = location.href.split("page/")[1]; var html = `
` body.append(html) } query(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } } var {footer, query, throttle} = new Util();