hashchange Event oldURL and newU
作者:
Ysj1111 | 来源:发表于
2018-09-04 08:41 被阅读10次//Polyfill hashchange Event oldURL and newURL attributes for IE 9+
(function(){
if(!window.HashChangeEvent){
let lastURL=document.URL;
window.addEventListener('hashchange',function(e){
let oldURL=lastURL;
let newURL=document.URL;
lastURL=newURL;
Object.defineProperties(e,{
oldURL:{enumerable:true,configurable:true,value:oldURL},
newURL:{enumerable:true,configurable:true,value:newURL},
});
});
}
}());
参考链接
本文标题:hashchange Event oldURL and newU
本文链接:https://www.haomeiwen.com/subject/ymjbsxtx.html
网友评论