var xmlHttp = false;
if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}else if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.ActiveXObject){
xmlHttp= new ActiveXObject("Msxml2.XMLHTTP");
}
function getAjax()
{
var url = "my_xml.xml";
if(xmlHttp){
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState === 4 && xmlHttp.status === 200){
var data = xmlHttp.responseXML;
//var books = data.getElementsByTagName("book");
// your function;
// books[i] .getElementsByTagName('author')[0].firstChild.nodeValue
//books[i] .getElementsByTagName('title')[0].firstChild.nodeValue
}
};
xmlHttp.open("POST", url, true);
// xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.send(null);
}
}