Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created April 27, 2018 17:08
Show Gist options
  • Select an option

  • Save simonmorley/c477ed38955dfb6d809b31d6d657c096 to your computer and use it in GitHub Desktop.

Select an option

Save simonmorley/c477ed38955dfb6d809b31d6d657c096 to your computer and use it in GitHub Desktop.

Revisions

  1. simonmorley created this gist Apr 27, 2018.
    24 changes: 24 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <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>