i have an xmli file link ( http://ift.tt/1CUCOFo)



i am new to xml file integration i want to link a xml file which have the link (http://ift.tt/1CUCOFo) form my website how can I link this ?



<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse:collapse;
}
th, td {
padding: 5px;
}
</style>
</head>
<body>

<script>
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","http://ift.tt/1CUCOFo",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;

document.write("<table><tr><th>Add Type</th><th>Unit_Type</th></tr>");
var x=xmlDoc.getElementsByTagName("LISTING");
for (i=0;i<x.length;i++)
{
document.write("<tr><td>");
document.write(x[i].getElementsByTagName("Ad_Type")[0].childNodes[0].nodeValue);
document.write("</td><td>");
document.write(x[i].getElementsByTagName("Unit_Type")[0].childNodes[0].nodeValue);
document.write("</td></tr>");
}
document.write("</table>");
</script>

</body>
</html>

No comments:

Post a Comment