You can post JSON data to the server using the following.
<script>
var dat = JSON.stringify(dataToSend);
$.post( "process.php", dat,function(data)
{
alert("Response: " + data);
});
</script>
However when you try to decode the above in php for example, you wont find the data as we have not given a post variable. We can slightly modify the above and include a post variable which is easy to read from PHP.
var dat = JSON.stringify(dataToSend);
$.post('process.php', { data: dat}, function(data){ alert(data)}, "text");
The above has been compressed into a few lines.
Inside the PHP we can now get the POST variable named 'data'.
You can also set the data like this.
postdata={ "val" : value, "val2":value2, "val3":"a value"};
$.post('callme.php', postdata, function(data)
{
document.location.reload(true);
});