Skip to content

Instantly share code, notes, and snippets.

@zanematthew
Created July 8, 2013 01:56
Show Gist options
  • Save zanematthew/5945722 to your computer and use it in GitHub Desktop.
Save zanematthew/5945722 to your computer and use it in GitHub Desktop.
non-working IE8 AJAX success. ajaxSubmit plugin: http://jquery.malsup.com/form/#getting-started
$('#jdugc_upload_form').on('submit', function(event) {
event.preventDefault();
$('.loading-icon').show();
$(this).ajaxSubmit({
target: 'myResultsDiv',
type: 'post',
dataType: 'json',
start: function(){
$('.loading-icon').show();
},
success: function( msg ){
if ( $('#jdg_upload_target_1 img').length == 0 ){
$('#jdg_upload_target_1').html( '<img src="'+msg.url+'"/>' );
} else if ( $('#jdg_upload_target_2 img').length == 0 ){
$('#jdg_upload_target_2').html( '<img src="'+msg.url+'"/>' );
} else if ( $('#jdg_upload_target_3 img').length == 0 ){
$('#jdg_upload_target_3').html( '<img src="'+msg.url+'"/>' );
}
$('#jdgugc_attachment_ids').val( $('#jdgugc_attachment_ids').val() + ',' + msg.attachment_id );
document.getElementById('jdugc_upload_form').reset();
$('#fb_photo_url').val("");
$('#jdugc_dialog').dialog('close');
$('.loading-icon').hide();
}
});
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment