Created
April 7, 2014 05:11
-
-
Save ayato-p/10015136 to your computer and use it in GitHub Desktop.
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
execute: (form_id, success_proc, fail_proc) -> | |
$form_obj = $(form_id) | |
_url = $form_obj.attr('action') | |
_type = $form_obj.attr('method') | |
_data = new FormData($form_obj[0]) | |
$.ajax | |
type: _type | |
url: _url | |
processData: false | |
contentType: false | |
dataType: 'json' | |
data: _data | |
.done (res) -> | |
return success_proc(res) | |
.fail -> | |
return fail_proc() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment