這裏我試圖用Flask測試FusionCharts,並且當它用作純HTML和沒有Python代碼的JavaScript時,我無法使它工作。Fusion Charts not rendering
的layout.html
<!DOCTYPE html>
<html>
<head>
<title>Flask Fusion</title>
<script type="text/javascript" src="../static/fusion.js"></script>
<script type="text/javascript" src="../static/jquery.min.js"></script>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
的index.html
{% extends 'layout.html' %}
{% block content %}
<div id="chartContainer">FusionCharts XT will load here!</div>
<script type="text/javascript"><!--
var myChart = new FusionCharts("../static/Column3D.swf",
"myChartId", "400", "300", "0");
myChart.setXMLUrl("data.xml");
myChart.render("chartContainer");
// -->
</script>
{% endblock %}
目錄結構
我發現data.xml
文件由哪個都是這樣
127.0.0.1 - - [12/Jan/2014 13:25:35] "GET/HTTP/1.1" 200 -
127.0.0.1 - - [12/Jan/2014 13:25:35] "GET /static/fusion.js HTTP/1.1" 304 -
127.0.0.1 - - [12/Jan/2014 13:25:35] "GET /static/jquery.min.js HTTP/1.1" 304 -
127.0.0.1 - - [12/Jan/2014 13:25:35] "GET /data.xml HTTP/1.1" 404 -
127.0.0.1 - - [12/Jan/2014 13:25:35] "GET /static/Column3D.swf HTTP/1.1" 304 -
127.0.0.1 - - [12/Jan/2014 13:25:35] "GET /data.xml?FCTime=261 HTTP/1.1" 404 -
但路徑data.xml
是完全正確的控制檯看到日誌返回404
。我不知道爲什麼它不渲染。請幫忙。