Skip to content

Instantly share code, notes, and snippets.

@travist
Created August 31, 2016 21:30
Show Gist options
  • Select an option

  • Save travist/7132676025d226fd637f197c5be94368 to your computer and use it in GitHub Desktop.

Select an option

Save travist/7132676025d226fd637f197c5be94368 to your computer and use it in GitHub Desktop.

Revisions

  1. travist created this gist Aug 31, 2016.
    24 changes: 24 additions & 0 deletions ajax.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    var submission = {
    data: {
    firstName: 'Test',
    lastName: 'Person',
    email: 'test@example.com',
    phoneNumber: '123123123123'
    }
    };
    var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://myproject.form.io/myform",
    "method": "POST",
    "headers": {
    "content-type": "application/json",
    "cache-control": "no-cache"
    },
    "processData": false,
    "data": JSON.stringify(submission)
    }

    $.ajax(settings).done(function (response) {
    console.log(response);
    });