Object Expected Error In Ajax
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about jquery object expected error Stack Overflow the company Business Learn more about hiring developers or posting ads object expected error in javascript while calling a function with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
Ie8 Javascript Object Expected
is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Jquery Validate & IE Object Expected Error up vote 0 down vote favorite
Object Expected Jquery Ie10
I recently implemented jquery validate on my user login page. Code works great in FF and Chrome, but bombs out in IE 8 & above. I can't figure out what the issue is so I've finally given in and decided to ask for help This is the json that is returned - {"REDIRECT_URL":"","ERR_MSG":"Username or password is invalid","ERR_NUM":12} See my submit method below, IE fails inside the $.ajax call on the object expected error in internet explorer 8 line where the url param is specificed. The error is SCRIPT438: Object doesn't support this property or method submitHandler: function(form) { if($("#user_login").valid()){ var isValidLogin = false; var user = $("#username").val(); var pwd = $("#user_password").val(); $.ajax({ type: 'GET', contentType: 'application/json; charset=utf-8', url: 'data_handler.php', data: "user=" + user + "&pwd=" + pwd, dataType: 'json', success: function (data) { redirect_url = data.REDIRECT_URL; err_msg = data.ERR_MSG; if(err_msg == ""){ location.href = redirect_url; isValidLogin = true; } else{ if(redirect_url != ""){ location.href = redirect_url; } else{ $('#err_alert').show(); $('#err_alert').html(err_msg); } isValidLogin = false; } }, error:function(){ } }); } else{ return false; } return false; } jquery ajax jquery-validate share|improve this question edited Apr 3 '13 at 0:41 Sparky 65.1k17110190 asked Apr 2 '13 at 22:42 Mike Anderson 101110 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted A line number for the error will help. But in any case you should declare your vars: success: function (data) { var redirect_url = data.REDIRECT_URL; var err_msg = data.ERR_MSG; What is probably happening is that the json that is returning does not contain your mentioned properties REDIRECT_URL and/or ERR_MSG. You can test the json is correct by navigating directly to data_handler.php?user=youruser&pwd=yourpwd Also Chrome and FF are probably showing th
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss
Object Expected Error In Javascript In Ie8
the workings and policies of this site About Us Learn more javascript runtime error: object expected about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow script5007: object expected Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping http://stackoverflow.com/questions/15775734/jquery-validate-ie-object-expected-error each other. Join them; it only takes a minute: Sign up Jquery error: Object expected up vote 2 down vote favorite 1 This is my code in aspx page