-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajax.html
More file actions
executable file
·52 lines (42 loc) · 816 Bytes
/
ajax.html
File metadata and controls
executable file
·52 lines (42 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<script>
function ajax()
{
var ajaxRequest;
try{
ajaxRequest=new XMLHttpRequest();
}
catch(e)
{
try{
ajaxRequest=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try{
ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
}
}
}
ajaxRequest.onreadystatechange=function()
{
if(ajaxRequest.readyState==4)
document.form.Time.value=ajaxRequest.responseText;
}
ajaxRequest.open("GET","ajax.php",true);
ajaxRequest.send(null);
}
</script>
</head>
<body>
<form name="form">
<input type="text" onChange="ajax();" name="Name">
<br />
<input type="text" name="Time">
</form>
</body>
</html>