Created
June 15, 2018 16:35
-
-
Save lnorton89/4d535f2c413afc7de3e5d608d1b82e4c to your computer and use it in GitHub Desktop.
This file contains 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
$('#myForm').on('sumbit', function(){ | |
var form = $(this); | |
var formdata = false; | |
if (window.FormData){ | |
formdata = new FormData(form[0]); | |
} | |
var formAction = form.attr('action'); | |
$.ajax({ | |
url : '/', | |
data : formdata ? formdata : form.serialize(), | |
cache : false, | |
contentType : false, | |
processData : false, | |
type : 'POST', | |
success : function(data, textStatus, jqXHR){ | |
alert('success') | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment