I have a server returning a 500 status code, and my jQuery Form calls a success callback instead of an error callback.
jQuery version: 1.7.1
jQuery version: 2.73 march 2011
apache2 server
Here are some code snippets:
var options =
{
error : on_upload_error
, success : on_upload_succes
};
$( '#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 server headers seem right 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 not get this to show "in error function". In addition, the statusText parameter returned by on_upload_success contains the string "success".
All hints are welcome.
source
share