<script>
// 控制手机物理键--返回
window.onload = function(){
if(window.history && window.history.pushState) {
$(window).on('popstate', function() {
var hashLocation = location.hash;
var hashSplit = hashLocation.split("#!/");
var hashName = hashSplit[1];
if(hashName !== '') {
var hash = window.location.hash;
if(hash === '') {
alert("你点击了返回键");
//location.href ='/xcview/html/apprentice/inherited_introduction.html' /*跳转链接*/
}
}
});
window.history.pushState('forward', null, './#forward'); //引号里写当前页面地址,刷新当前页'./inherited_introduction.html'
}
};
</script>
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!