Order of Jquery ajax events

Order of Jquery ajax events

Is there in order to the jQuery Ajax events?
Below is a spinet of code using Ajax to retrieve data. If the Ajax op is "complete", but not "success" I want the background will be set yellow and if the Ajax op is "complete" and "success" background will be set to green.

The background is always set to yellow. However, if the code that sets the background to yellow is commented out then the background color is green.

It appears as though that "complete" status always executes after "success".
  1. $.ajax({
  2. url:"spanishTranslation.php",
  3. data: 'term='+ term,
  4. success: function(data){
  5. $("#translateThis").html(data);
  6. }
  7. }).complete(function(){
  8. $("input#translate").css("background-color","yellow");
  9. }).success(function(){
  10. $("input#translate").css("background-color","green");
  11. }).error(function(){
  12. //$("input#translate").css("background-color","green")
  13. $("input#translate").css("background-color","red");
  14. });

  15.