javascript监听手机返回键
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 === '') {
$('.tcclose').css('display', 'none');
return false;
}
}
});
window.history.pushState('forward', null);
}
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/18812.html