简体   繁体   English

d3.csv通过HTTPS?

[英]d3.csv over HTTPS?

I know that d3.csv makes an HTTP get request. 我知道d3.csv发出了HTTP get请求。 But what if my file is stored in a place with HTTPS protocol? 但是,如果我的文件存储在具有HTTPS协议的地方怎么办? I can store all my files(the .js, the data and the .html that holds everything together) in the same directory but they are all accessed via HTTPS. 我可以将所有文件(将所有内容包含在一起的.js,数据和.html)存储在同一目录中,但是它们都可以通过HTTPS访问。

Unfortunately I have no option to go http because this is for a work application on the company intranet. 不幸的是,我没有选择http的权限,因为这是用于公司Intranet上的工作应用程序的。

Your javascript app is (largely) protocol agnostic and it doesn't matter to the program whether the protocol is HTTP or HTTPS. 您的javascript应用程序与协议无关(大部分情况下),并且协议是HTTP还是HTTPS对程序都无关紧要。 Those details will be handled by the browser and as long as certificates do not present a problem, the user is not likely to notice either. 这些详细信息将由浏览器处理,只要证书不存在问题,用户也不大可能注意到。

If all your files are saved on the same server within the same root folder, you should make requests relative to your own path, eg d3.csv('./data.csv') , and it should work just fine. 如果所有文件都保存在同一根文件夹中的同一台服务器上, 则应 对于自己的路径发出请求,例如d3.csv('./data.csv') ,它应该可以正常工作。 Only if your are making cross domain requests does protocol become important. 仅当您发出跨域请求时,协议才重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM