I am using a safecracker form in EE to upload an entry via the front-end and i am using jQuery Form Plugin.
The problem is IE tries to download the json response. I know this is an issue that has been brough up a fair bit and i have looked around for a solution that works, but none of them were using EE and jQuery Form Plugin.
Here is the ajax js:
$('#publishForm').ajaxForm({
dataType: 'json',
beforeSubmit: function() {
// Photo input validation
var photo = $('#publishForm input[type="file"]').val();
if( photo == null || photo == '' ) {
$('#publishForm #photo_error').show();
return false;
}
},
success: function(data) {
if (data.success) {
console.log('You successfully added a new entry with entry_id ' + data.entry_id);
}
else {
console.log('Failed with the following errors: ' + data.errors.join(', '));
}
}
});
I don’t know if there is another paramter i need to put in to fix it or do some hacky fix.
Thanks
What is you response header’s content-type / mime-type you are responding?
Is it
content-type: application/jsonIt seems like an IE bug, that if you are using lettercase header settings like
Content-Type: application/jsonAn IE client downloads the response.
Example response header: