Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created April 27, 2018 17:08
Show Gist options
  • Save simonmorley/c477ed38955dfb6d809b31d6d657c096 to your computer and use it in GitHub Desktop.
Save simonmorley/c477ed38955dfb6d809b31d6d657c096 to your computer and use it in GitHub Desktop.
<script>
var email;
var origin;
var url = 'https://api.ctapp.io';
var success = function() {
$('#success').removeClass('hide');
$('#submit').prop('disabled', function(i, v) { return !v; });
};
$(document).on("submit", "#request", function( event ) {
console.log('APPLES')
event.preventDefault();
var values = $(this).serialize();
email = $('input[name="email"]').val();
origin = $('input[name="origin"]').val();
$.ajax({
type: 'POST',
url: url + '/api/v1/person_timelines',
data: $(this).serialize(),
error: function(){
},
success: success,
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment