Hi there. I'm having trouble using Deferreds to do some basic AJAX
calls. Something fundamental I'm not clear on yet.
With re. to the following fragment
Q) Where does the callback function return its variable to? How can you
access it?
Q) How can you check whether the callback has happened yet from another
function (e.g. business() below so that you don't continue until it's
taken place?
function check() {
d.loadJSON("/foo/bar");
d.addCallback(resultsItem);
}
function resultsItem() {
// record the results of the checking someplace - where?
checks = something;
return checks;
}
function business() {
check();
// don't go forward until results of check are handled
do something reliant on check() being accurate;
}
Any help would be great!
Thanks
.M.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---