- Your first attempt is passing the paramaters as a json string.
- Your second attempt is missing
=
signs.
You can pass a object to data
, and jQuery will serialize it properly.
$.ajax(
{
post: 'GET',
data: {
firstName: $('myFirstName').val(),
lastName: $('myLastName').val()
},
...