I have a working web service at http://localhost/RestService/GetTransactionByStatus/1. When I run that URL on my browser I\'m getting the correct JSON-formatted response:
Look at the documentation. Here is an example:
d3.json('http://localhost/RestService/GetTransactionByStatus/' + id, function(data) {
console.log(data.transactionConcil);
});
As of d3 v5, this has become
d3.json('http://localhost/RestService/GetTransactionByStatus/' + id)
.then(function(data) {
console.log(data.transactionConcil);
});
Update 2019:
For any host - localhost
or some server
, you can directly get data by just mentioning rest api path
, so that your code can be used on any server
d3.json("/RestService/GetTransactionByStatus/" + id, function(error, data) {
console.log(data);
});