Now we need to determine whether the browser is closed or refreshed, and perform the corresponding operation...
天蓬老师2017-06-12 09:33:54
Refresh call:Onunload
Close call:onbeforeunload
Can be specified in the <script> script through window.onunload or specified in <body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
<script>
window.onbeforeunload = function(){
return "quit?";
}
</script>
</html>
Reference: http://www.jianshu.com/p/e920...
伊谢尔伦2017-06-12 09:33:54
load() method
Example:
$("img").load(function(){
$("p").text("Image loaded");
});
Modified question:
Here is a question similar to yours, take a look:
/q/10...