


js leave or refresh page detection (and compatible with FF, IE, Chrome)_javascript skills
May 16, 2016 pm 04:57 PM<!DOCTYPE html>
<html>
<head>
<script>
function closeIt()
{
return "Any string value here forces a dialog box to n"
"appear before closing the window." ;
}
window.onbeforeunload = closeIt;
</script>
</head>
<body>
<a href="http:// www.jb51.net">Click here to navigate to
www.jb51.net</a>
</body>
</html>
Compatible with FF, IE, and Chrome js detection for leaving or refreshing the page, the key part is to have return

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to use JS and Baidu Maps to implement map pan function

Recommended: Excellent JS open source face detection and recognition project

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts

How to create a stock candlestick chart using PHP and JS

How to use JS and Baidu Maps to implement map polygon drawing function

How to use JS and Baidu Map to implement map click event processing function

How to use JS and Baidu Maps to implement map heat map function
