JQuery - 点击浏览器后退键时发出警告 (demo)

jQuery(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;
                                if (hash === '') {
                                    alert("Back button isn't supported. You are leaving this application on next clicking the back button");
                                }
                            }
                        });
                        window.history.pushState('forward', null, './#forward');
                    }
                });

JQuery - 点击浏览器后退键时发出警告 (demo)

JQuery - 点击浏览器后退键时发出警告

上一篇:浅谈平面设计是什么 平面设计概论介绍


下一篇:如何创建Joomla快速安装包