I have a server returning Status code 500 and my jQuery Form calls the success callback instead of the error callback.
jQuery version: 1.7.1
jQuery Form version: 2.73 march 2011
server apache2
These are some code snippets:
var options =
{
error : on_upload_error
, success : on_upload_succes
};
// bind form using 'ajaxForm'
$( '#upload-form' ).ajaxForm( options );
function on_upload_error( jqXHR, textStatus, errorThrown )
{
console.log( "in error function" );
}
function on_upload_succes( responseText, statusText, xhr, form )
{
console.log( 'responsText: ' + responseText );
console.log( 'statusText: ' + statusText );
console.log( xhr );
console.log( form );
// ....
}
The headers from the server seem correct to me:
HTTP/1.1 500 Internal Server Error
Date: Wed, 09 May 2012 18:35:11 GMT
Server: Apache/2.2.16 (Debian)
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 405
Connection: close
Content-Type: text/html; charset=iso-8859-1
I can't get this to show "in error function". On top of that, the statusText parameter returned to on_upload_success contains a string "success".
All clues welcome