vue系列 url的hash和HTML5的history

url的hash和HTML5的history

URL的hash

URL的hash也就是锚点(#), 本质上是改变window.location的href属性.
我们可以通过直接赋值location.hash来改变href, 但是页面不发生刷新

history

H5的history接口是HTML5新增的, 它有五种模式改变URL而不刷新页面,history是一个栈

history.pushState()

history.back()

相当于浏览器的返回历史上一页,等价于 history.go(-1)

history.forward()

等价于 history.go(1)

history.go()

history.replaceState()

相关文章

类型转换 1、int转string 2、string转int 3、string转float ...
package main import s "strings" import...
类使用:实现一个people中有一个sayhi的方法调用功能,代码如...
html代码: beego代码:
1、读取文件信息: 2、读取文件夹下的所有文件: 3、写入文件...
配置环境:Windows7+推荐IDE:LiteIDEGO下载地址:http:...