loading.............
Debería quedar así.
Código PHP:
function Search(idin,results,url,wait){
var inputSearch = document.getElementById(idin);
var DivResultto = document.getElementById(results);
var LoadingWait = document.getElementById(wait);
if(inputSearch.value != '' && inputSearch.value.length > 1){
ajax = objetoAjax();
ajax.onreadystatechange=function() {
if(ajax.readyState == 4){
DivResultto.innerHTML = ajax.responseText;
LoadingWait.style.display = 'none';
DivResultto.style.display = '';
}
}
LoadingWait.style.display = '';
DivResultto.style.display = 'none';
ajax.open("GET", url+inputSearch.value);
ajax.send(null);
}
else{
return false;
}
}
Antes del open. y si crees que aun así es muy rápido.
Código PHP:
function Search(idin,results,url,wait){
var inputSearch = document.getElementById(idin);
var DivResultto = document.getElementById(results);
var LoadingWait = document.getElementById(wait);
if(inputSearch.value != '' && inputSearch.value.length > 1){
ajax = objetoAjax();
ajax.onreadystatechange=function() {
if(ajax.readyState == 4){
setTimeout(function(){
DivResultto.innerHTML = ajax.responseText;
LoadingWait.style.display = 'none';
DivResultto.style.display = '';
},5000);
}
}
LoadingWait.style.display = '';
DivResultto.style.display = 'none';
ajax.open("GET", url+inputSearch.value);
ajax.send(null);
}
else{
return false;
}
}
connection closed.