Reputation: 1351
Is it possible to make synchronous ajax requests using d3.xhr (and/ or any of it's convenience methods) ? I am talking about something like jQuery's async: false option. 10x
Upvotes: 3
Views: 582
Reputation: 38720
No but there is still hope. The "a" in "ajax" may stand for "asynchronous", but third argument of XMLHttpReques.open() is sometimes useful. You can't do synchronous requests with d3 because it has that option hardcoded to be true. So if you really need to, you can override that behavior (generally it's not cool to mess with library code though) or simply use a callback to kick off execution of whatever you need after data is loaded and processed.
Upvotes: 1