-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex2.html
More file actions
31 lines (28 loc) · 797 Bytes
/
index2.html
File metadata and controls
31 lines (28 loc) · 797 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
<html>
<body>
<div id="div">
</div>
<input type="button" id="boton" value="boton">
</input>
<script>
var content = document.getElementById('div');
document.getElementById('boton').onclick = function() {
var url = "http://moncadaisla.es/ajax.php";
var params = "lorem=ipsum&name=binny";
var http = new XMLHttpRequest();
http.open("GET", url+"?"+params, true);
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
content.innerHTML = http.responseText;
}
}
http.send(null);
}
</script>
<form action="http://moncadaisla.es/ajax.php" method="get">
<input type="text" name="loren"/>
<input type="hidden" name="name" value="bea"/>
<input type="submit"/>
</form>
</body>
</html>