Loop with attachEventListener

V

vunet

Hi,
How to implement this? I have a global variable var maxGlobalCounter,
myGlobalNumber which store max ID counter and current ID identifier. I
want to make a number of xmlhttp requests which must use
myGlobalNumber to point to correct ID. For example:

for(var i=0;i<maxGlobalCounter; i++){
var obj = document.getElementById("someElem"+i);
myGlobalNumber = i;
if(obj){
//make xmlhttp request, use myGlobalNumber in handler function
}
}

Because I use myGlobalNumber a lot to find correct IDs, I want to
continue loop when myGlobalNumber is reset to "" somewhere in xmlhttp
handler function. Can I use attachEventListener to do that? Any better
ideas?
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,657
Members
45,412
Latest member
HemantSod
Top