这段代码在玉器中显示错误

时间:2014-10-29 06:10:24

标签: javascript node.js express pug

此Jade代码无效。

head
    script(src='http://d3js.org/d3.v3.min.js')
    script(src='http://dimplejs.org/dist/dimple.v2.1.0.min.js')

body
    script(type='text/javascript')
        var svg = dimple.newSvg("body", 800, 600);
        var data = [
        { "Word":"Hello", "Awesomeness":2000 },
        { "Word":"World", "Awesomeness":3000 }
        ];
        var chart = new dimple.chart(svg, data);
        chart.addCategoryAxis("x", "Word");
        chart.addMeasureAxis("y", "Awesomeness");
        chart.addSeries(null, dimple.plot.bar);
        chart.draw();

1 个答案:

答案 0 :(得分:0)

自翡翠version 1.0.0起,您必须添加.才能将script代码设为文字:

body
    script(type='text/javascript').
        // above here
        var svg = dimple.newSvg("body", 800, 600);
        var data = [
        { "Word":"Hello", "Awesomeness":2000 },
        { "Word":"World", "Awesomeness":3000 }
        ];
        var chart = new dimple.chart(svg, data);
        chart.addCategoryAxis("x", "Word");
        chart.addMeasureAxis("y", "Awesomeness");
        chart.addSeries(null, dimple.plot.bar);
        chart.draw();