test esame

This commit is contained in:
2015-01-17 03:44:06 +01:00
parent 7f21febb90
commit a5322258bf
9 changed files with 571 additions and 73 deletions

56
ajax_xml.html Normal file
View File

@@ -0,0 +1,56 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Titolo</title>
<meta name="" content=""/>
</head>
<body>
<span> reading xml with ajax</span>
<span id="content"></span>
<script>
var request = new XMLHttpRequest();
request.addEventListener("load",loadfunction,false);
request.open("GET","xml.php");
request.send();
function loadfunction(){
var content = document.getElementById("content");
if (content){
var data = request.responseXML;
var c = data.documentElement.children;
for (i=0;i< c.length;i++){
content.innerHTML+= c[i].childNodes[0].nodeValue;
}
}
}
</script>
</body>
</html>