code in xmlhttp.readyState==4 doen't get executed
- by shazia
function download() {
    if (window.XMLHttpRequest)   {// code for IE7+, Firefox, Chrome, Opera, Safari   
        xmlhttp=new XMLHttpRequest();
    } else   {// code for IE6, IE5  
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  
    } 
    xmlhttp.onreadystatechange=function() 
    {   //alert(xmlhttp.readyState);
        if(xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            alert (xmlhttp.responseText);
        }   
    }
    xmlhttp.open("GET","import.php?file="+document.getElementById('uploaded_file').value,false);
    xmlhttp.send(); 
  //  location.reload(true);
}
if I put alert and monitor xmlhttp.readyState then it shows me that its status does turn 4 and it does go in the if statement, if I don't monitor it with alert then it doesn't go in the if statement but I know import.php is working because I can see the changes in the database. I don't know whats going on...can anyone help.
Thanks