I have a script that is used to make ajax calls and it takes the callback function as a parameter. It then uses an eval to call that function with the responseText.
[code=javascript]
function makeHttpRequest (myURL, callbackFunctio n, returnXML, callType, parms)
{
.....
http_request.on readystatechang e = function() {
if (http_request.r eadyState == 4) {
if (http_request.s tatus == 200) {
...