Here is my function. It is a general purpose wrapper for various AJAX
call in my program. Since the callback could be any function, I'm
passing the callback function as a string and calling it via window
[callBack], which kinda of works except it's not waiting for the
actual AJAX call to complete - it fires right away. Since I wrapped
the callback in an anonymous function, I would have expected the
execution to be deferred, but it isn't.

Where have I gone wrong?

function exFetch(url,element,callBack) {
        now = new Date() //break cache
        //$('lastAjax').innerHTML = url +"|"+element
        new Ajax.Updater(element, url+'&_UserReference='+key+'&now='+now,
{method:'get',evalScripts:true,onComplete:function(transport) {
                window[callBack]
          }
        });
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to