I have an issue specific to IE8 with the jQuery form plugin.
I am uploading a single file through a multipart/form-data and am using the jQuery plugin to do error handling. Everything works fine in FF but in IE8, the jqHXR object that gets passed in the error handling method is empty (status = 0, text = null, etc. instead of status = 500, text = "Some error message"). Here is some of the code I am using:
HTML Form:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<form name=\"myForm\" id=\"myForm\" action=\"uploadServlet\" method=\"POST\" enctype=\"multipart/form-data\">");
<input type=\"file\" id=\"browseBox\" name=\"file1\"/>
<input type=\"submit\" id=\"uploadButton\"/>
</form>
jQuery:
$("#myForm").submit(upload);
$("#myForm").ajaxForm();
function upload() {
var options = {
async: false,
success: uploadSuccessful,
error: uploadError
}
$("#myForm").ajaxSubmit(options);
return false;
}
function uploadSuccessful(data) {
alert(data);
}
function uploadError(jqXHR, textStatus, err) {
alert(jqXHR.responseText);
}
Like I mentioned jqXHR is empty in IE8, but not so in FF. The servlet responds with plain text that I display to the user. Any ideas why IE8 specifically fails at getting the response from my servlet ?