gpt4 book ai didi

javascript - ( flask ,d3) Uncaught ReferenceError : d3 is not defined

转载 作者:行者123 更新时间:2023-12-02 15:19:11 26 4
gpt4 key购买 nike

我是 d3.js 新手。我正在尝试部署this example在我的 Flask 应用程序上。然而,它不断地给我一个错误——“Uncaught ReferenceError: d3 is not Defined”。我什至在服务器上下载了 d3.v2.min.js 文件,但它不起作用。这是我的 html 代码:

<html>
<head>

<title>Quarterly Report to the City and County of Denver</title>

<script type="text/javascript" src=""{{ url_for('static', filename='js/d3.v2.min.js') }}" charset="utf-8"></script>

<script type="text/javascript" src="{{ url_for('static', filename='js/makeMultiTable.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/setupPlot.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/drawLinePlot.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/toggleStat.js') }}"></script>

<script type="text/javascript" src="{{ url_for('static', filename='js/load_qtrly_stats.js') }}"></script>

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/line_plot.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/table.css') }}" />

</head>

<body>

<div id="table"></div>

<div id="plot"></div>

</body>

最佳答案

<title>Quarterly Report to the City and County of Denver</title>
<!--- Fixed syntax error in the below line --->
<script type="text/javascript" src="{{ url_for('static', filename='js/d3.v2.min.js') }}" charset="utf-8"></script>

<script type="text/javascript" src="{{ url_for('static', filename='js/makeMultiTable.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/setupPlot.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/drawLinePlot.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/toggleStat.js') }}"></script>

<script type="text/javascript" src="{{ url_for('static', filename='js/load_qtrly_stats.js') }}"></script>

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/line_plot.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/table.css') }}" />
</head>
<body>
<div id="table"></div>
<div id="plot"></div>
</body>

关于javascript - ( flask ,d3) Uncaught ReferenceError : d3 is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34215780/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com