Hello. I have a code in JS that works perfectly in other browsers, however, IE only works with debugger (F12) enabled.
Here is an excerpt from my JS:
<script src="http://code.jquery.com/jquery-latest.js"></script>functionlogin(){varcheckCpf=document.getElementById("cpf").value;
var checkPass = document.getElementById("pass").value;
if(checkCpf == '' || checkPass == ''){
document.getElementById("confirmacao").innerHTML="<p>Você precisa informar seu CPF e sua senha para entrar!</p>";
document.getElementById("cpf").value = '';
document.getElementById("pass").value = '';
document.getElementById("cpf").focus();
}else{
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}else{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
var callback = xmlhttp.responseText;
if(callback !=0)
window.location.replace(callback);
else{
document.getElementById("confirmacao").innerHTML="<p>CPF e/ou senha inválidos!</p>";
}
}
}
var params = $('form#login').serialize();
xmlhttp.open("POST","valida.php",false);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(params);
document.getElementById("cpf").value ='';
document.getElementById("pass").value ='';
}
};