Update 2019:
For any host - localhost host or any server you can directly receive data by simply specifying the rest api path so that your code can be used on any server
d3.json("/RestService/GetTransactionByStatus/" + id, function(error, data) { console.log(data); });
source share