-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththis.html
More file actions
46 lines (35 loc) · 923 Bytes
/
this.html
File metadata and controls
46 lines (35 loc) · 923 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
<script>
function createRequestObject()
{
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer")
{ ro = new ActiveXObject("Microsoft.XMLHTTP"); }
else
{ ro = new XMLHttpRequest(); }
return ro;
}
var http = createRequestObject();
function sndReq()
{ u = document.getElementById("N100").value
http.open('get' , 'ajax1.php?data=' + u + "&junk="+Math.random() ); //forces not from cache
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse()
{ if( http.readyState == 4 )
{ var response = http.responseText;
//alert(response)
document.getElementById("N200").innerHTML = response
}
}
</script>
<style type="text/css">
div { background-color: yellow; }
</style>
<html>
<body>
<input type="text" id="N100" onkeyup="sndReq()">Enter
<div id="N200"></div>
</body>
</html>