Last active
December 12, 2015 02:58
-
-
Save vumanhcuongit/4702502 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
$('form#new_task').submit(function() { | |
$.ajax({ | |
type: "POST", | |
url: $(this).attr('action'), //sumbits it to the given url of the form | |
data: { | |
data_1: value_1, | |
data_2: value_2 | |
}, //input gui di | |
dataType: "HTML", | |
success(function(result){ | |
// result la gia tri tra ve tu controller | |
//do something | |
}); | |
}); | |
return false; // dung cho muc dich ko chuyen trang | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment