Created
July 8, 2013 01:56
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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