Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/07/2011, 14:07
Avatar de Melecio
Melecio
 
Fecha de Ingreso: julio-2011
Ubicación: Coahuila
Mensajes: 320
Antigüedad: 12 años, 9 meses
Puntos: 8
Respuesta: problemas con httprequest

pues le movi un poco pero en ie explorer no me funciono en firefox si jalo le voy a intentar aber si sale...


--------------------
var xmlhttp;
var xmlhttp;
//------CREAMOS OBJETO------//
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest;
}
else{
xmlhttp = new ActiveObject("Microsoft.XMLHTTP");
}


//------CREAMOS OBJETO------//

xmlhttp.open("GET","notices.xml", true);

xmlhttp.onreadystatechange = getXMLData;
xmlhttp.send(null);


function getXMLData(){

if (xmlhttp.readyState = 4 && xmlhttp.status == 200){

xmlDoc = xmlhttp.responseXML;
txt = "";
x = xmlDoc.getElementsByTagName("RCONTENT");

for (i=0 ; i< x.length ; i++){
txt = txt + x[i].childNodes[0].nodeValue + "<br/>";
}

document.getElementById("noticias").innerHTML = txt;
}else{
alert('no se pudo cargar el archivo');
document.write(xmlhttp.readyState + "<br/>");
document.write(xmlhttp.status);
}
}