200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > js拦截物联返回键跳转到指定页面

js拦截物联返回键跳转到指定页面

时间:2022-12-28 19:57:03

相关推荐

js拦截物联返回键跳转到指定页面

js网页拦截物联返回键跳转到指定页面

<script type="text/javascript">$(document).ready(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;var sy_url = "{$article['sy_url']}";if (hash === '' && (sy_url != null && sy_url != '')) {window.location.href = sy_url;}}});}window.history.pushState('forward', null, '#'); //在IE中必须得有这两行window.history.forward(1);});</script>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。