$.ajax().always() or $.ajax().complete()
So i'm starting to migrate from the prototype library to jquery. the ajax commands are pretty similar, but i'm struggling with jquery's callbacks. I know i either want to use the .complete() or .always(). The .success() and .error() callbacks aren't for me since order of operations is important and i generally want to perform the same set of functions whether or not it was successful.
Basically I use ajax in 2 ways. 1) to send a command to the server and get back a JSON object with the result info. and 2) to pull back plain HTML content and put it in a div.
I know the docs say to start using .always() instead of .complete(). but they function differently. As far as .complete() goes, it returns the jqXHR object which has jqXHR.responseText. this is fine for just HTML but I have to manually parse the JSON (unless i'm missing something). With .always(), it returns a pre-parsed string or object depending on whether it was HTML or JSON, the status, and the jqXHR object. This is great until the status isn't 'success'. In that case, the variable that supposedly contained the response from the server now contains the jqXHR object. It seems like i now have to do a bunch of ifs in order to determine what to do when. I can't just throw the contents of the response variable in my div because it could be the jqXHR object and i can't treat it as my JSON object because now its an object of a different kind.
Any thoughts to steer me in the right direction?