In questo tutorial di html.it dopo xmlDoc = document.implementation.createDocument("", "", null);
scrive xmlDoc.onload = readXML();
Ma poi nella pagina seguente, la funzione readXML() viene scritta così:
Anche se non ho capito cosa centri "app" passato alla funzione, quando in xmlDoc.onload = readXML(); non c'è nessun paramentro passato, ho fatto la stessa cosa, scrivendo:Codice PHP:
function readXML(app){
var x = xmlDoc.getElementsByTagName('item');
var text = '';
for (i=0;i < x.length;i++)
{
for (j=0;j < x[i].childNodes.length;j++)
{
if (x[i].childNodes[j].nodeType != 1) continue;
//text += x[i].childNodes[j].nodeName + ": " + x[i].childNodes[j].firstChild.nodeValue + "";
text += x[i].childNodes[j].nodeName + ": " + x[i].childNodes[j].firstChild.nodeValue + "";
}
}
alert(text);
var app = document.getElementById('textAPP');
app.innerHTML = text;
}
ma non funge....Codice PHP:
function readXML(){
var ris = xmlDoc.getElementsByTagName("risoluzione")
alert(ris.length);
}