I suggest you look jquery doc for ajax
here is a sample usage of ajax method:
$.ajax({
type: "POST", // type POST or GET
url: "some.php", // php file that data send to
data: { name: "John", location: "Boston" } // here is your data in json format
})
.done(function( msg ) {
alert( "Data Saved: " + msg );
});
data format is really simple, it's format just like this
{ key: 'value', anotherKey: 'anotherValue', ... }
and you can access data in php like this
$firstData = $_POST['key']; // this variable contains 'value'
$secondData = $_POST['anotherKey']; // this variable contains 'anotherValue'
anything your write instead of key
and anotherKey
is key of your variable in $_POST
and value
& anotherValue
are those values