0
d3.csv("result.csv", function(flights) {
var nestByDate = d3.nest()
.key(function(d) { return d3.time.day(d.date); });
..........
當我試圖從web服務器上面運行d3.js代碼時,它通過加載csv文件正確執行d3.js。XMLHttpRequest無法加載文件?
,但是當我試圖如下所示運行d3.js,
d3.csv("D:\\Project Space\\D3Demo\\WebContent\\result.csv", function(flights) {
var nestByDate = d3.nest()
.key(function(d) { return d3.time.day(d.date); });
..........
則顯示以下錯誤:
XMLHttpRequest cannot load file:///D:/Project%20Space/D3Demo/WebContent/result.csv. Cross origin requests are only supported for HTTP`
如何解決這個問題呢?