D3.js-从Chrome加载CSV文件 [英] D3.js - load csv file from chrome

查看:196
本文介绍了D3.js-从Chrome加载CSV文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有dc.js(d3.js + crossfilter.js)和ndx.csv文件的webProject.当我从Visual Studio中将项目运行到Chrome中时,一切正常.现在,在构建项目并复制到其他计算机之后,运行该文件.
问题在这里.当我尝试使用 Chrome 在其他计算机上运行webProject [html文件]时,此浏览器显示错误" XMLHttpRequest无法加载file:///C:/Users/9901/Desktop/WebSite1/ndx.csv.跨源请求仅支持以下协议方案:http,数据,chrome,chrome扩展名,https,chrome-extension-resource."但尚未找到解决方案. 提示:

I 've got a webProject with dc.js (d3.js+crossfilter.js) and ndx.csv file. When i run project into chrome from visual studio, everythings is Ok. Now after build project and copy in other computers, Run that.
The problem is here. When i try to run webProject [html file] in other computers with Chrome, this browser has error "XMLHttpRequest cannot load file:///C:/Users/9901/Desktop/WebSite1/ndx.csv. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource." I search about this problem, but haven't found solution. Hints:

  1. 我只想使用浏览器"Chrome便携式" ,否则就不会出现IE和FireFox的问题
  2. 我正在运行的地址栏:" 文件:///C:/Users/User-1/Desktop/WebSite1/Index.html ".
  3. 我在 其他计算机 中没有网络服务器.
  1. I want just use browser "Chrome Portable", Otherwise no problrm with IE and FireFox
  2. My addressbar in run: "file:///C:/Users/User-1/Desktop/WebSite1/Index.html".
  3. I don't have web server in other computers.

推荐答案

我解决了我的问题:

  1. 创建快捷方式并打开其属性.
  2. 在目标字段的字符串末尾添加 -allow-file-access-from-files .

这篇关于D3.js-从Chrome加载CSV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆