Search code examples
javascriptajaxodatasynchronousdatajs

How to do synchronous OData requests using datajs?


I have a list of URIs and while iterating over that list I send OData GET requests via OData.read().

My problem is that those calls are asynchronous and I want them to be synchronous. Is there any way to accomplish that?

As far as I know the given parameters of OData.read() won't allow this. But maybe there is some kind of work-around?


Solution

  • I solved the problem by using a recursive function, triggering the next ajax request exactly then, when the response of the previous is received.