Created
April 4, 2017 00:19
-
-
Save alexdev27/7a3c496ad76be2402c2435a2a82fd439 to your computer and use it in GitHub Desktop.
ajax func
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
function ajaxForm(form, urlToFile) { | |
// if (!valid) {return false;} | |
var serailizedForm = form.serialize(); | |
var result = $.ajax({ | |
url: urlToFile, | |
type: 'post', | |
// dataType: 'json', | |
data: serailizedForm, | |
}).fail(function(answerFromServer){ | |
alert('AJAX FAIL '); | |
}); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment