How do I send data (query string) using the queue defer methods?
Currently I use d3.json
to get a static file as below.
queue()
.defer(d3.json, "js/file1.json")
.defer(d3.xhr, 'js/file2.json')
.await(callback)
now, I need to also 'GET' a .php file, possibly sending some data via query string. In JQuery, I do
$.getJSON('ajax/file1.php', {data: some_var}, callback)
So, I tried to wrap the above in a function and pass it to defer
.
get_paths = function(path) {$.getJSON(path, {data: some_var})}
queue()
.defer(d3.json, "js/world-110m_MC.json")
.defer(get_paths, 'ajax/file1.php')
.await(callback);
but, unfortunately, callback is not invoke at all (though, I see the two ajax requests being made via the network tab in chrome)