You're hiding the element again before the request has completed. Move the
visibility = "hidden"
line inside the
if
block in the
onreadystatechange
callback:
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
document.getElementById("outerpicwrapper").innerHTML = "";
document.getElementById("mems").innerHTML = xmlhttp.responseText;
document.getElementById("loadgif").style.visibility= "hidden";
}
};
xmlhttp.open("GET","getmembers.php?q2="+str,true);
xmlhttp.send();