摘要: 1.直观区别: hash模式url带#号,history模式不带#号。 2.深层区别: hash模式url里面永远带着#号,我们在开发当中默认使用这个模式。 如果用户考虑url的规范那么就需要使用history模式,因为history模式没有#号,是个正常的url适合推广宣传 功能也有区别,比如我们 阅读全文
posted @ 2019-12-13 18:43 老北京(LBJ) 阅读(11458) 评论(0) 推荐(2) 编辑
摘要: 浏览器窗口有一个history对象,用来保存浏览历史。 检查浏览器是否支持 if (window.history){ // 支持History API } else { // 不支持 } history对象提供了一系列方法,允许在浏览历史之间移动。 其中包括 history.back(); 回退hi 阅读全文
posted @ 2019-11-12 16:04 老北京(LBJ) 阅读(2907) 评论(0) 推荐(0) 编辑
摘要: //直接上代码 let express = require('express'); let http = require('http'); let https = require('https'); let request = require('request'); let qs = require('querystring'); var fs = require('fs'); let multe 阅读全文
posted @ 2019-09-06 18:14 老北京(LBJ) 阅读(524) 评论(0) 推荐(0) 编辑
摘要: var CreateDiv = function (html) { this.html = html; this.init(); }; CreateDiv.prototype.init = function () { var div = document.createElement('div'); div.innerHTML = this.html; document.body.appendChi 阅读全文
posted @ 2019-08-30 18:07 老北京(LBJ) 阅读(114) 评论(0) 推荐(0) 编辑
摘要: h5本地存储的操作 // 存储localStorage export const setStorage = (name, value) => { if (!name) return; if (typeof value !== 'string') { value = JSON.stringify(value) } window.localStorage.setItem(name, value); } 阅读全文
posted @ 2019-08-23 10:32 老北京(LBJ) 阅读(138) 评论(0) 推荐(0) 编辑
摘要: function remInit (){ window.onresize = r; function r(resizeNum) { //核心适配代码 var winW = window.innerWidth; // document.getElementsByTagName("html")[0].style.fontSize = w... 阅读全文
posted @ 2019-08-16 10:31 老北京(LBJ) 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 参考代码: var drag1 = document.getElementById(‘drag1’); drag1.onmousedown = function(ev){ var x = ev.clientX - drag1.offsetLeft; var y = ev.clientY - drag 阅读全文
posted @ 2018-03-27 16:19 老北京(LBJ) 阅读(865) 评论(0) 推荐(0) 编辑