Commit e6eb123b authored by 朱松文's avatar 朱松文

关闭浏览器弹框提示

parent 8a2e212d
...@@ -13,16 +13,6 @@ ...@@ -13,16 +13,6 @@
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<script>
window.addEventListener('beforeunload',function(event){
alert('')
console.log('aa',event)
})
// window.onbeforeunload = function (e) {
// alert('')
// }
</script>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
...@@ -42,3 +42,18 @@ new Vue({ ...@@ -42,3 +42,18 @@ new Vue({
store, store,
render: (h) => h(App), render: (h) => h(App),
}).$mount("#app"); }).$mount("#app");
/*
//关闭浏览器弹框提示
window.onbeforeunload = function (e) {
e = e || window.event;
// 兼容IE8和Firefox 4之前的版本
if (e) {
e.returnValue = '关闭提示';
}
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示';
} */
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment