ajax e dom

This commit is contained in:
2014-12-07 19:33:49 +01:00
parent c30036a3bc
commit 7f21febb90
13 changed files with 423 additions and 64 deletions

34
ajax.html Normal file
View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<p> Ciao, Simone è gay?</p>
<p id="answer"></p>
<script>
req= new XMLHttpRequest();
req.addEventListener("load",handler,false);
req.open("GET","ajax.php",true);
req.send();
function handler(e){
document.getElementById("answer").innerHTML = req.responseText;
}
</script>
</body>
</html>