Lets say for example:
$(\".button\").click(function() { $.post(\"commandrunner.php\", { param1: \'value\', param2: \'val
That is the right approach to the problem.
The easiest way to find out the context would be to use Firebug and console.log(this) — I suspect it would be the XHR object though.
console.log(this)