Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("input.submit-btn").click(function(event) {
- event.preventDefault();
- var formData = $(this).parents('form').serialize();
- //console.log(formData);
- var url = "participants/ajax_index";
- $.post(url, {
- //data: formData
- data: formData
- }, function(data) {
- if (data == 1){
- share();
- $("#vote_container").remove();
- $("#thank_you_msg").show();
- }
- else{
- alert(data);
- }
- }, "html")
- .done(function() {
- console.info("second success");
- })
- .fail(function(data) {
- alert('fail');})
- .always(function() { console.info("finished"); });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement