Hi everyone, hoping for a gentle ride:

I mostly program actionscript rather than javascript, so although the
syntax is similar i get a little stuck now and then.

I'm using the global ajax.responders method to start an animation
whenever an ajax request is made, and stop the animation upon
completion of the request.  however it does not work with synchronous
requests. The onSuccess method of my ajax requests work as they
should, however the timer continues to animate.  It's as if the
ajax.responders onComplete method isn't called.

any idea what i'm doing wrong?

thx

kenneth


Ajax.Responders.register({
  onCreate: function(){
        ajaxPageTimer = new __ajaxTimer('ajaxPageTimerBox',100);
        ajaxPageTimer.startAnimation();
  },
  onComplete: function(){
        ajaxPageTimer.stopAnimation();
  }
});


var mainPages = Array();
var myRequests = new Object;

function loadPages(pageSource, page)    {
        var url;
        var i = 1;
        //loadPage();
        function loadPage()     {
                url = "incfiles/main" + i + ".php";
                myRequests[i] = new Ajax.Request(url,   {
                onSuccess: function(transport){
                                mainPages[i] = url;
                                pasteMainContent.defer(transport.responseText, 
i);
                                i++;
                                if (i<menu.num+1)       loadPage();     //so 
this is faux asyncronous
                }
                });
        }
}

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