views:

151

answers:

2

Hi guys. This is my code, which sometimes works and sometimes doesn't.

var resolve_ajax_login=function(){
  $.ajaxSetup({cache:false });
  var loginvar=$("#inputlogin").attr("value");
  var senhavar=$("#inputsenha").attr("value");
  $.post("../model/php/login_ajax.php",
        {login:loginvar, senha:senhavar},
        function(responseText){
            if (responseText=="ok"){ 
                window.location="areatrab.php";

            }else{
                $("#inputlogin").attr("value","");
                $("#inputsenha").attr("value","");
                $("#divmensagem").html("<span style='color:red;font-size:70%;'>"+responseText+"</span>");

            }
        }
  );
  return false;
};

Ok. It's in portuguese but I think you get the general picture. Sometimes this works, no problem, but some other times (only in IE, no problem whatsoever in Firefox) it throws a javascript error in my jquery.js file (minified). The error description is as follows:

Object doesn't support this property or method: jquerymin.js line 123 character 183..

which amounts to...

{return new A.XMLHttpRequest}

somewhere in the middle of the jquery.js file. It seems to be very IE-specific, as I had no such problems on Firefox. This guy apparently had the same problem as I did, but got no responses yet.

Has anyone else seen this? Thanks in Advance

P.S.: I run IE 8

+1  A: 
taber
Hmm I could do it, but if it were the issue, wouldn't I be having this problem every time i try and send a request? The browser only screams on some occasions, not all..
Felipe Almeida
good point, let me add something else here..
taber
any luck w/ that?
taber
oh you mean create a different object if the browser is IE? Doesn't jquery take care of that for me?
Felipe Almeida
yes.. i tried and it didnt really work =//...I tried adding a random string to the url to force IE not to cache but it still didnt work..
Felipe Almeida
A: 

Guys, It's solved... It's something to do with the order in which you try all the different types of browsers in order to create the right kind of XMLHTTP REQUEST object.. I'll explain it in more detail in the following page:

http://stackoverflow.com/questions/3664462/ajax-inconsistency-in-ie-8

Felipe Almeida