Ver Mensaje Individual
  #10 (permalink)  
Antiguo 17/07/2013, 08:11
Avatar de cristo995
cristo995
 
Fecha de Ingreso: noviembre-2012
Mensajes: 187
Antigüedad: 11 años, 5 meses
Puntos: 0
Respuesta: Ajax no funciona en Chrome

probando otra forma con ajax.

function getXMLHttpRequest(){
var objetoAjax;
try{
objetoAjax = new XMLHttpRequest();
}catch(err1){
try{
objetoAjax = new ActiveXObject("Msxm12.XMLHTTP");
}catch(err2){
try{
objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
}catch(err3){
objetoAjax = false;
}
}
}
return objetoAjax;
}

var http = new getXMLHttpRequest();

function llamadaAjax(str){
http.open('GET','buscadorAjax.php?variable='+str,t rue);
http.onreadystatechange = estado;
http.send(null);
}

function estado(){
if(http.readyState==4){
if(http.status==200){
var respuesta = http.responseText;
document.getElementById('cajaAjax').innerHTML = respuesta;
}
}
else
{
document.getElementById('cajaAjax').innerHTML = '<img id="im_cargando" src="cargando.gif">';
}

}

con esto me a dado una luz en chrome digo una luz por q ahora aunque sea sale algo pero no sale bien ..

resultado en Mozilla y otros.. 100%bin



resultado en Google Chrome: 100% mal :(


como se puede ver es un tipo buscador estilo google que apenas presiono una tecla empieza a buscar en la BD pero no se q tendra Chrome q no funciona bien .

aqui el css donde se muestran los resultados.

#cajaAjax{
width:270px;
position:absolute;
margin-left:33.5%;
margin-top:37.5%;
text-align:left;
border:0px dashed gray;
background: #F2F2F2;
font-weight:lighter;
z-index:1;
padding-top:5px;
padding-bottom:5px;
padding-left:9px;
min-height: -10px;
border-radius:0px 10px 10px 0px;
}