Skip to content

Instantly share code, notes, and snippets.

@lightstrike
Created April 1, 2014 00:48
Show Gist options
  • Save lightstrike/9905617 to your computer and use it in GitHub Desktop.
Save lightstrike/9905617 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
// function used to make AJAX calls
function ajaxFormCall(event, formObject, successFunction, errorFunction) {
var data = new FormData(formObject.get(0));
event.preventDefault();
$.ajax({
data: data,
type: formObject.attr('method'),
url: formObject.attr('action'),
cache: false,
processData: false,
contentType: false,
success: successFunction,
error: errorFunction
});
return false;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment