Qualcuno mi sa spiegare perchè questo javascript non riesce a collegarsi al file xml specificato (dirxml)?
Il codice funziona se lo script e' eseguito in "locale" (non inserito in un dominio esterno) e il valore di
dirxml e' "/dnsanalisy/data/http@www.monna.splinder.com/storia.xml" se specifico un url assoluto, come nell'esempio riportato, non si collega al file che pure pare accessibile perchè richiamandolo con un browser il file è accessibile.
CODICE
--------------
var xmlDoc;
var dirxml;
dirxml = "http://dnsanalisy.amecom.it/dnsanalisy/data/http@www.monna.splinder.com/storia.xml";
xmlDoc=loadXMLDoc(dirxml);
var x=xmlDoc.getElementsByTagName('counter');
show = 0
for (i=0; i<x.length;i++)
{
show = (x[i].childNodes[0].nodeValue)
}
function loadXMLDoc(dname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument(""," ",null);
}
else
{
show = ('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
---------------
FINE
Grazie in anticipo
Amedeo