xmlhttprequest - How do I load JSON data synchronously with d3.js? -


when site first initializes, queries server data. can't lay out on page until data gets back. d3.js, can use d3.json() data, because it's asynchronous, need put entire page logic in callback function. how request data , wait come back?

you're doing way. callback function has 1 initiating rest of code. don't need code in callback function though, can introduce indirection. callback function call function inside in callback function.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -