Link to home
Create AccountLog in
Avatar of itnifl
itniflFlag for Norway

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.
ASKER CERTIFIED SOLUTION
Avatar of mcuk_storm
mcuk_storm
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of itnifl

ASKER