I'm trying to make the AJAX call bark and squick at me so I'm executing a totally wrong URL. For some reason, none of the methods that are supposed to do the barking och squicking is invoked.
What is the reason?
$.ajax({
url: "http://totally.wrong.url",
dataType: 'jsonp',
error: function () { alert("bark 1"); },
failure: function () { alert("bark 2"); }
})
.fail(function () { alert("squick"); })
.done(function () { alert("woof"); });
Of course, if I change the URL to point to the correct WCF service, I get an approving woof.
According to jQuery API, I should use fail and done syntax but I'll be fine either way.
Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.