Антон C, а так?
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
#example-1{
text-align: center;
cursor: pointer;
}
</style>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div class="example cursor" id="example-1">Click to update</div>
<script>
function loadElement(url, callback) {
var request = new XMLHttpRequest();
try{
request.open('GET', url);
request.send(null);
request.onreadystatechange = function() {
if (this.readyState == 4)
callback(this.responseXML);
};
} catch(e) {
request = new ActiveXObject("Microsoft.XMLDOM");
request.load(url);
callback(request)
}
}
var div = document.getElementById('example-1');
div.onclick = function ()
{
loadElement('./1.xml', function(xmlDoc) {
var x=xmlDoc.getElementsByTagName("title");
var y=xmlDoc.getElementsByTagName("detail");
var z=xmlDoc.getElementsByTagName("date");
var html = ''
for (i=0;i<x.length;i++)
{
html +=x[i].childNodes[0].nodeValue;
html +=y[i].childNodes[0].nodeValue;
html +=z[i].childNodes[0].nodeValue;
}
div.innerHTML = html
})
}
;
</script>
</body>
</html>