PDA

View Full Version : مبتدی: اشکال درایجاد یک کانتر با java script



EBRAHIMIEKOKDARAGHI
سه شنبه 07 شهریور 1391, 17:15 عصر
با سلام خدمت اساتید محترم

لطفا" اشکال سند html زیر را که در آن شمارنده مربوطه کار نمی کند برای من توضیح دهید
با تشکر فرآوان

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="timeout.aspx.cs" Inherits="tamrinjavascript2.timeout" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/ecmascript">
var counter = 0;
id = setTimeout("update();", 2000);
function update() {
counter++;
window.status = "the counter is now at" + counter;
document.form1.input1= "the conter is new at :" + counter;
id =window.setTimeout("update();", 2000);
}
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<input type="text" name="input1" size="40"/><br />
<input type="button" value="reset"onclick="counter=0;" /><br />
<input type="button" value="stop"onclick="window.clearTimeout(id);" /><br />
</div>
</form>
</body>
</html>