我是javascrpting的新手,這是一個完全新手的問題。錯誤在.html指出,並指向.js
我有一個index.html
文件看起來像:
<!DOCTYPE html>
<html>
<head>
<title>The d3 test</title>
<style>
.chart {
}
.main text {
font: 10px sans-serif;
}
.axis line, .axis path {
shape-rendering: crispEdges;
stroke: black;
fill: none;
}
circle {
fill: steelblue;
}
</style>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
</head>
<body>
<div class='content'>
<!-- /the chart goes here -->
</div>
<script type="text/javascript" src="scatter.js"></script>
</body>
</html>
注意scatter.js
這裏是一個JavaScript來創建一個d3.js
情節。
此代碼將無法正常工作,當我嘗試來檢查使用Chrome和Ctrl+Shift+J
錯誤,我得到這個錯誤:
這是什麼錯誤,爲什麼瀏覽器混淆.html
和.js
?
您使用的是什麼http服務器? – Craneum
我正在使用[django](https://www.djangoproject.com/) – farhawa
使用curl和-i標記獲取scatter.js併發布結果。此外,請張貼URL路徑(即/static/scatter.js,/widgets/index.htm等) – Craneum