【发布时间】:2013-02-20 15:18:00
【问题描述】:
我刚刚将downloaded D3.js from d3js.org(zip 文件的链接)解压缩,并在以下 HTML 页面中引用它:
<html>
<head>
<title>D3 Sandbox</title>
<style>
</head>
<body>
<script src="/d3.v3.js"></script>
</body>
</html>
但是当我加载这个页面时,我的控制台(在 Chrome 中)给了我这个错误:
Uncaught SyntaxError: Unexpected token ILLEGAL: line 2
它不喜欢pi and e symbols at the start of the file。 Errrr ...我该怎么办?我正在使用 python 的 SimpleHTTPServer 提供文件。
更新:是的,我知道我可以链接到 CDN 版本,但我更愿意在本地提供文件。
【问题讨论】:
-
我的问题是 simplehttpserver 默认不支持 utf8:stackoverflow.com/questions/15288891/…
标签: javascript d3.js