$.get($(this).attr('rel'), function(response){}, 'script')
.error(function(){ alert('this failed')});
I get. .error is not a method . But it was added in version 1.4.3
Is there some kind of type I have ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The return value of
$.getin jQuery 1.4.3 does not have a.errormethod. I am actually not sure what the return value is, but you should be able to check it .. whatever it is, it doesn’t have.error. You will have to bind it to something else.At some point, jQuery started returning jqxhr objects from
$.get,$.post,$.ajax, etc. I believe this is after 1.5 when they introducedDeferred, but I’m not 100% sure. The jqxhr object has.done,.failand.always(implementingDeferred), so you would be able to do$.get().fail()at some point after jQuery 1.5. You definitely can in jQuery 1.7.Either upgrade jQuery or use
$.ajaxinstead witherroras a setting.