{
alert('xmlCall ini ' + url );
var xmlDoc;
var xmlhttp;
if (window.XMLHttpRequest)
{
alert('XMLHttpRequest ini ' + url );
xmlhttp=new XMLHttpRequest();
alert('XMLHttpRequest after' );
}
else
{
alert('Else XMLHttpRequest' );
try
{
xmlhttp=new ActiveXObject("MSXML2.ServerXMLHTTP");
}
catch (e) {}
try
{
xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.6.0");
}
catch (e) {}
try
{
xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
catch (e) {}
try
{
xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
}
catch (e) {}
try
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {}
throw new Error("This browser does not support XMLHttpRequest.");
}
alert('xmlhttp.open ini');
xmlhttp.open("GET",url,false) ;
alert('xmlhttp.open after');
try
{
alert('xmlhttp.send ini');
xmlhttp.send();
alert('xmlhttp.send after');
var i = 0;
var xmlDoc = xmlhttp.responseXML;
for (i = 0; i < xmlDoc.getElementsByTagName('ROWID').length; i++) {
alert('Id:' + xmlDoc.getElementsByTagName('ROWID')[i].firstChild.nodeValue);
alert('descr:' + xmlDoc.getElementsByTagName('descr')[i].firstChild.nodeValue);
}
}
catch (e) { alert('Error de lectura ' + e.message + 'en ' + url); };
xmlDoc = xmlhttp.responseXml;
}
xmlCall( 'http://server/service.asmx/GetCountry');
No hay comentarios:
Publicar un comentario