I looked at the code and and I'm not sure I understand what you're
trying to do, but like Steven and Pheonix I suspect the problem is
timing related and *not* specific to Firebug, Firebug just happened to
help uncover it.
It looks like you're queuing up requests to only use two
XMLHttpRequest objects at a time. Why bother? Sure, the browser only
will perform two requests at a time anyway, but it will handle queuing
them up for you.
If you want to ensure the responses are handled in the same order the
requests were made I would do something simple like the following:
reqQueue = [];
function orderedAjaxRequest(url) {
var req = new XMLHttpRequest(); // replace with cross browser
version
req.open("GET", url, true);
req.onreadystatechange = processQueue;
reqQueue.push(req);
req.send(null);
}
function processQueue() {
while (reqQueue.length > 0 && reqQueue[0].readyState == 4) {
var req = reqQueue.shift();
// do something with the response
}
}
When a request is made it's added to the queue, then whenever the
status of any of the requests changes it checks to see if the *first*
one is ready, and if so it processes it, then the next one, etc.
If I've misunderstood what you're trying to do then disregard
everything I said ;)
On Oct 21, 10:23 am, JMJimmy <[EMAIL PROTECTED]> wrote:
> I just completed ajax queue system and I ran into a rather serious
> problem with Firebug.
>
> I run a series of calls onload to get 6 unique files an process them
> in the order they were called as a test script.
>
> <BODY ONLOAD="ajaxTextGet('hello.txt'); ajaxTextGet('hello2.txt');
> ajaxTextGet('hello3.txt'); ajaxTextGet('hello4.txt');
> ajaxTextGet('hello5.txt'); ajaxTextGet('hello6.txt');">
>
> They contain a one line instruction to do a document.body.innerHTML =
> document.body.innerHTML + '<DIV>Call: ' and then JS adds a number and
> the closing </DIV>.
>
> The result on all browsers (including Firefox with Firebug disabled)
> is
>
> Call: 1
> Call: 2
> Call: 3
> Call: 4
> Call: 5
> Call: 6
>
> When Firebug is enabled it usually gives me:
>
> Call: 2
> Call: 1
> Call: 3
> Call: 4
> Call: 5
> Call: 6
>
> or some other variation.
>
> It's manifesting in two ways:
>
> 1) The initial onload calls are not in order - ie: executed as 1, 3,
> 2, 6, 4, 5 (or some variation)
> 2) If the initial calls are called correctly (1, 2, 3, 4, 5, 6) the
> resulting DOM updates are not applied in order ie: updated as shown
> above, 2,1,3,4,5,6 (or some variation)
>
> This only occurs when Firebug is enabled, and it is very consistent
> when it's enabled - it almost always happens. In all other browsers
> (Windows - Opera, Firefox (-Firebug), IE7, Chrome, Safari; OSX -
> Firefox, Safari) it works as expected every time. The second Firebug
> is enabled it screws up.
>
> http://www.phpdev.ca/canshare/index_1.0.0.php- so you can see what is
> going on. If you look at the DOM portion you'll notice a variable
> called 'tracer' - this is the order of events being executed in the
> code which should match the result on the page (but does not due to
> bug).
>
> Details on my Firebug config:
> YSlow installed
> All 'Show' options are enabled, with the exception of DOM constants.
>
> JMJimmy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Firebug" 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/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---