itnifl
asked on
Loading with Ajax and storing information until ready
I used this guide:
https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started
Until the httpRequest.status is 200 and httpRequest.readyState is 4 I want to save some data and reuse it when loading is ready. The whole Ajax code is within a loop that loops through an array. When httpRequest.status is 200 and httpRequest.readyState is 4, the array is no longer valid(it is while loading), and thus its data is no longer reachable. The array that I loop through represents rows in a table. I can update the rows via innerHtml while loading, but since the whole array is lost when loading is complete and I enter the code where httpRequest.status is 200 and httpRequest.readyState is 4, I can't re-update the rows again, wich I want.
https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started
Until the httpRequest.status is 200 and httpRequest.readyState is 4 I want to save some data and reuse it when loading is ready. The whole Ajax code is within a loop that loops through an array. When httpRequest.status is 200 and httpRequest.readyState is 4, the array is no longer valid(it is while loading), and thus its data is no longer reachable. The array that I loop through represents rows in a table. I can update the rows via innerHtml while loading, but since the whole array is lost when loading is complete and I enter the code where httpRequest.status is 200 and httpRequest.readyState is 4, I can't re-update the rows again, wich I want.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER