stackoverflow'dan bir cevap
var a = {};
a['test'] = 1;
a['test2'] = 2;

// or


var a = {};
a.test = 1;
a.test2 = 2;

// or


var a = {
test : 1,
test2 : 2
};

$.ajax({
url: baseUrl+"chat.php",
data: a,
type: 'post',
success: function(data) {
alert(data);
}
});
You may then access the data in your PHP script like this:

$_POST['test'];
$_POST['test2'];