class Utils { constructor() { } $(className) { return document.querySelector(className); } _(className) { return document.querySelectorAll(className); } query(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } footer() { var footerList = [ { title: '首页', img: 'home', isActve: true, url: './index.html' }, { title: '视频', img: 'video', isActve: false, url: './video.html' }, { title: '分类', img: 'type', isActve: false, url: './type.html' }, { title: '我的', img: 'like', isActve: true, url: './like.html' }, ]; // 当前访问的页面地址 var currentUrl = location.href.match(/page\/([\s\S]*?).html/)[1] $("body").innerHTML+=` ` } } var { $, _, footer, query } = new Utils();