Hell all:

I'm making a doSimpleXMLHttpRequest call, if the result is wait, I've
to call this again, until success. But I understand once call is made,
am not able to make the call again. But how to achieve this? Pls let
me know. Thx.

Here is my code:

var getLoginStatus = function(token) {
   var doExec = function (req) {
      xml = req.responseXML;
      var statusNode = xml.getElementsByTagName('status')[0];
      var status = parseInt(statusNode.childNodes[0].nodeValue);

      if(status == 2) { // login success
         // do success
      } else if(status == 1) { // still processing
         MochiKit.Async.callLater(5000, getLoginStatus(token)); //
call again
      }
   };

   var doError = function () {
   };

   var res = MochiKit.Async.doSimpleXMLHttpRequest(url);
   res.addCallbacks(doExec,doError);
};


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to