标签:listen 原理 回退 bsp oca his style state event
1. hash
修改的时候:history.pushState(‘名字‘, null, ‘/xxx‘) || location.hash = ‘/xxx‘
回退的时候:window.addEventListener(‘statepop‘ || ‘hashchange‘)
2. history
修改的时候:history.pushState(‘名字‘, null, ‘/xxx‘)
回退的时候:window.addEventListener(‘statepop‘)
标签:listen 原理 回退 bsp oca his style state event
原文地址:https://www.cnblogs.com/amiezhang/p/11570259.html