Die Codekopie lautet wie folgt:
<%@ page Language = "java" contentType = "text/html; charset = utf-8"
pageCoding = "utf-8"%>
< %@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<kopf>
<titels> Nur wenn eine Anfrage innerhalb eines bestimmten Zeitraums gesendet werden kann </title>
<script type = "text/javaScript" src = "$ {pageContext.request.contextPath} /editor/jquery/jquery-1.4..min.js"> </script>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" />
<Script Language = "JavaScript">
var Maxtime = 10; // Legen Sie mindestens 10 fest, um eine Anfrage zu senden
Funktionstest (obj) {
if (obj.value == 'subine') {
überprüfen();
btn = setInterval ("Countdown ()", 1000);
}anders{
ALERT ("Nur einmal in eine Minute senden!");
}
}
Funktion Countdown () {
if (Maxtime> = 0) {
Sekunden = math.floor (Maxtime%60);
msg = "Es gibt immer noch"+Sekunden+"Sekunden", wenn die Zeit endet;
$ ("#btn"). Val (MSG);
-MaxTime;
}anders{
$ ("#btn"). Val ("Commit");
ClearInterval (BTN);
Maxtime = 10;
}
}
Funktion check () {
Alarm ("Haha, ich bin es!");
}
</Script>
</head>
<body>
<input type = "button" id = "btn" value = "suruging" onclick = "test (this)"/>
</body>
</html>