window.onhashchange = function(e){ console.log(e); }
打印出来的结果能够经过location.hash得到浏览器url路径中的#部份内容,上图是#bvc,若是想获取#后面的内容可经过location.hash.slice(1),上图是bvc前端