Created
April 6, 2016 16:46
-
-
Save DominicBreuker/9a149b7aa65c23dd455183b2721d5d7c 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
<script data-cfasync="false" type="text/javascript"> | |
jQuery( document ).ready(function( $ ) { | |
var request; | |
$("#my_form").submit(function(event){ | |
if (request) { request.abort(); } | |
$('#result').text('Sending data...'); | |
request = $.ajax({ | |
url: "https://script.google.com/macros/s/AKfycbz4aFabJ80gajXFBcXlFLpR6n9ad9GHs4UcT6ux9w7RAYcI_9w/exec", | |
type: "post", | |
data: $(this).serialize() | |
}); | |
// on success | |
request.done(function (response, textStatus, jqXHR){ | |
$('#result').text('Success - look at your sheet!!'); | |
}); | |
// on failure | |
request.fail(function (jqXHR, textStatus, errorThrown){ | |
$('#result').text('Failure - is the service running?'); | |
}); | |
event.preventDefault(); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment