The simplest use would be something like this, which you place in your_plugin_directory/script.js:
var path = DOKU_BASE + 'lib/plugins/your_plugin_directory/test.php';
jQuery.post(path, function(data) {
alert("Data Loaded: " + data);
});
The script test.php would return data.
You can pass in parameters:
params 'value1='+encodeURIComponent(value1) + '&value2='+encodeURIComponent(value2) ;
jQuery.post(path,
params,
function(data) {
alert("Data Loaded: " + data);
});
Then your script test.php will get these through the $_POST global. They have to be urldecoded; I use rawurldecode().
You can download my ckgedit and look at ckgedit/ckeditor/config.js, which has two jQuery posts and, also in ckgedit/ckeditor you will find the php scripts which are called by the ajax functions.