[jQuery] $.ajax call doesn't complete on 400 bad request response

2010-01-18 Thread anton
Can't seem to get any response from an ajax call which response is 400
Bad Request

  $.ajax({
   url: url
   type: GET,
   dataType: json,
   success: aj.dataLoaded,
   error: function() {
 alert(error);
   },
   complete: function() {
 alert(complete);
   }
 });

When server responds with error code 400 neither the error function
nor the complete function is called, any tips on how to correct this?
Could there be a problem with parsing output, since this particular
response also gives an error message in text/plain not JSON? Have
tried with both processData set to false and true but with the same
problem...

Have tried both jQuery 1.3 and 1.4

-- Anton


Re: [jQuery] $.ajax call doesn't complete on 400 bad request response

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote:
 Can't seem to get any response from an ajax call which response is 400
 Bad Request

      $.ajax({
               url: url
               type: GET,
               dataType: json,
               success: aj.dataLoaded,
               error: function() {
                 alert(error);
               },
               complete: function() {
                 alert(complete);
               }
             });

 When server responds with error code 400 neither the error function
 nor the complete function is called, any tips on how to correct this?

What is aj.dataLoaded doing? I believe a 400 will go to the success
callback; after that finishes (assuming it does so :) it should call
the complete callback. Can the call to complete be disabled by
returning false from the success/error callback?

Nathan


Re: [jQuery] $.ajax call doesn't complete on 400 bad request response

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote:
 Can't seem to get any response from an ajax call which response is 400
 Bad Request

      $.ajax({
               url: url
               type: GET,

Hey, is that missing comma after url a typo?

Nathan