Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/04/2008, 01:59
viktoria
 
Fecha de Ingreso: septiembre-2006
Mensajes: 349
Antigüedad: 17 años, 7 meses
Puntos: 0
Re: En IE respuesta ajax tarda 5 minutos!

Disculpen, el resto del codigo no lo puse pensando como funciona en Mozilla Firefox el problema debe originar en instanciar el objeto XMLHTTPrequest

aqui adjunto el resto

Código PHP:
function redArea(nrol){

  var 
area=nrol.value;

 var 
id_congreso=document.getElementById('id_congreso').value;
    
  var 
miAleatorio=parseInt(Math.random()*9999999);

var 
url='get_papers.php?area='+area+'&id_congreso='+id_congreso;

miPeticion.open('GET'url+'&rand='+miAleatoriotrue);

miPeticion.onreadystatechange=respuestaAjax;

miPeticion.send(null);
}

function 
respuestaAjax(){
    
    
alert(miPeticion.readyState);
        
alert(miPeticion.status);

if (
miPeticion.readyState==4){
    
alert(miPeticion.readyState);
        
alert(miPeticion.status);

    if (
miPeticion.status==200){
        
alert(miPeticion.readyState);
        
alert(miPeticion.status);
        
/*get array of papar tag */
        
var papers miPeticion.responseXML.getElementsByTagName('paper');

        
/*? array exists create new table*/
            
if(papers.length){
                
                var 
tab document.createElement('table');
                var 
tabBody document.createElement('tbody');
                
                    for(
i=0i<papers.lengthi++){
                    
                    
/* get childNode "id" value */
                    
var id papers[i].getElementsByTagName('id')[0].firstChild.nodeValue;
                    
                    
/* get childNode "title" value and create text Node */
                    
var title document.createTextNode(papers[i].getElementsByTagName('titulo')[0].firstChild.nodeValue);
                    
                    var 
row document.createElement('tr');
                    
                    
/*cell with checkbox*/
                    
var cellCb document.createElement('td');
                    
                    
/*cell with title of paper*/
                    
var cellTitle document.createElement('td');
                    
                    
/*check box*/
                    
var cb document.createElement('input');
                    
cb.type "checkbox";
                    
cb.id "id_paper[]";
                    
cb.value id;
                    
                    
cellCb.appendChild(cb);
                    
cellTitle.appendChild(title);
                    
                    
row.appendChild(cellCb);
                    
row.appendChild(cellTitle);
                    
                    
tabBody.appendChild(row);
                    }
                    
                
tab.appendChild(tabBody);
                
document.getElementById('respuesta').appendChild(tab);
                
        } else {
               
document.getElementById('respuesta').innerHTML="No existe ninguna comunicación!";
        }
    } else {
        
//creamos mensaje de error
        
document.getElementById('respuesta').innerHTML="Ha ocurrido un error: "+miPeticion.statusText;
    }
} else {
//si readyState ha cambiado pero !=4
document.getElementById('respuesta').innerHTML='Cargando la información ............!';
}