I'm using d3.json to get a dynamic data.
d3.json("/myweb/totalQtyService.do", function(json) {
drawChart(json);
});
How do I post parameter on d3.json?
i.e.
data : {
year: "2012",
customer: "type1“
}
Any idea pass those parameter on post? not url parameter /myweb/totalQtyService.do?year=2012&customer=type1
I tried such below, but couldn't make it work. because the data structure so different
d3.json => [Object, Object, Object, Object]
$.ajax => {entity_name: "ACTIVA"entity_tar_val: 350entity_val: 400level: 1_proto_: Object},...
$.ajax({
type: "POST",
url: url,
// parameter here
data : {year: "2012", customer: "type1“},
success: function(json){
// console.log(json);
**drawChart(json);**
} ,
error:function (request, err, ex) {
}
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…