I have question of both logic and implementation for which so far googling netted me nothing of use.
- I need to access a webservice that can provide me 1,000 results at a time queries can return roughly 21,000 results
- I have no control over the webservice, just need to use it
- JS runs on a local machine or another webserver (ie NOT the server with the data)
So I wrote a small js script that calls it and parses the data, now my problem is that I written it using synchronous call (ie async: false). This presents a bunch of issues some of which mean that it only seems to work on chrome and not other browsers.
So my questions are:
How do you handle logic of making an asynchrnous call and parsing the results? - by the time I come out of the call, I have no results and they come in a bit later. How can I use them properly?
How can I do so using a webservice which I will need to poke a few times, for instance if I got a total of 10,000 results and the service returns only 1,000 at a time.
I am rather confused about these two aspects of the problem and would appreciate any help. I have tried to use ajax and cors, they both work to varying degree, but I do not understand how to handle the second part (only getting a subset of results at a time).
What methods are there for this given that originally I could not use async: true due to the "Access-Control-Allow-Origin". And I cannot modify the webservice.
Parsing a processing is already handled which I parse each individual xml reply to extract data I need and process it all at the later stage.
Would appreciate pseudo code for a reply, I am only starting out with learning JS so do not know all it is capable of doing.