JavaScript Callback Function Seems To Work, But Does Not Draw The Data
I've already been through many tutorials on callbacks (e.g. here, on SO and this gem) By far the best one was this gem. Especially this part helped me to understand. function addO
Solution 1:
Sometimes it's easier than you think...
java.alert("prepare called");
var json = JSON.parse(data);
draw(json);
Problem: data
was a String, d3 wants a JSON Object. Watch here. New output:
Alert: success
Alert: prepare called
Alert: [object Object]
Now renders the graph just fine. var data = {"nodes":[{"name":"sepp", [...]
works because JavaScript interpretes it as a JSON Object.
Post a Comment for "JavaScript Callback Function Seems To Work, But Does Not Draw The Data"