JS监听手机返回键
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('后退按钮点击'); } } });
window.history.pushState('forward', null, './#forward');
}
版权声明:本文为cl11992原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。