<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../Js/jQuery_OA.js"></script>
<title>JQuery防止退格键网页后退</title>
<script>
$(document).keydown(function (e) {
var doPrevent;
if (e.keyCode == 8) {
var d = e.srcElement || e.target;
if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') {
doPrevent = d.readOnly || d.disabled;
}
else
doPrevent = true;
}
else
doPrevent = false;
if (doPrevent)
e.preventDefault();
});
</script>
</head>
<body>
<%if Request("flag")=1 then%>
<a href="?flag=2">To 2</a>
<%elseif Request("flag")=2 then%>
<a href="?flag=1">To 1</a>
<%end if%>
</body>
</html>
JQuery防止退格键网页后退
最新推荐文章于 2021-08-06 15:01:16 发布