我正在尝试检测用户何时刷新页面以使用JQuery重定向,这段代码有什么问题? 但我没有尝试任何工作
<?php
include 'instagram.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<?php
$inst = new Instagram($_GET['code']);
?>
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous">
</script>
<script>
$(window).bind('beforeunload', function(){
alert("tryng to refresh");
});
</script>
</body>
</html>