1$.ajax({
2 url: 'users.php',
3 dataType: 'json',
4 type: 'post',
5 contentType: 'application/json',
6 data: JSON.stringify( { "first-name": $('#first-name').val(), "last-name": $('#last-name').val() } ),
7 processData: false,
8 success: function( data, textStatus, jQxhr ){
9 $('#response pre').html( JSON.stringify( data ) );
10 },
11 error: function( jqXhr, textStatus, errorThrown ){
12 console.log( errorThrown );
13 }
14});