Code the following code that I use after making an "Onsubmit" in form:
function buscar(){
resul = document.getElementById('resultado');
bus=document.frmbusqueda.dato.value;
tipo=document.frmbusqueda.tipo.value;
ajax=nuevoAjax();
ajax.open("POST", "busqueda.php",true);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
resul.innerHTML = ajax.responseText
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("busqueda="+bus);
}
Everything works perfectly. What I need is that before I get the result, add a loading image, in the code.
Some suggestions and / or help.
Thanks