I am generating an html file that brings data from an xml but if it is not inside my server it does not show it and I need to bring it from an external server since it will be managed from the outside. What is the error? the file is noticias.xml that I need that comes from an external server.
Thanks
What I do is a button that has onclick="loadXMLDoc () and in a table with id=" table "that I list them.
The problem is probably in the following script:
function loadXMLDoc() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xmlhttp.open("GET", "noticias.xml", true); xmlhttp.send(); } function myFunction(xml) { var i; var xmlDoc = xml.responseXML; var table="NoticiaFoto"; var x = xmlDoc.getElementsByTagName("CD"); for (i = 0; i " + x[i].getElementsByTagName("TITULO")[0].childNodes[0].nodeValue + "" + x[i].getElementsByTagName("FOTO")[0].childNodes[0].nodeValue + ""; } document.getElementById("demo").innerHTML = table; }