Author: Nerlaleph | Posted on: 4/6/2009 12:38:21 AM | Views : 469


 Hi folks, that's my problem;


I have a normal Ajax call to a WebService  


[javascript]:



Task.WebServices.AddRows.AddRowToTable(fileName, id, onSuccess); 

That works great on a normal click and i print correctly the result into DOM. Now, I need to call that webservice several times into a loop, so i write:


[javascript]



for(var i = 0; i < rows ; i++) {
globalId = i;
Task.WebServices.AddRows.AddRowToTable(fileName, i, onSuccess);
}


On every onSuccess, I have to print a table row. The problem is that the code print all the responses into the last row, such as it lost the globalId variables which I use to retrieve the correct row.
Hoping that somebody could understand my poor English and that can help me 
Cheers
Dave

...

Go to the complete details ...