运行Infragistics SparkLineChart示例时出现Javascript错误

时间:2013-10-11 10:19:11

标签: javascript html5 infragistics ignite-ui

我正在运行以下代码,这是Infragistics SparkLineChart示例中的示例代码:

 <!DOCTYPE html>
  <html>
   <head>
    <title></title>

    <!-- Ignite UI Required Combined CSS Files -->
    <link href="../../igniteui/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="../../igniteui/css/structure/infragistics.css" rel="stylesheet" />

    <script src="../../js/modernizr.min.js"></script>
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>

    <!-- Ignite UI Required Combined JavaScript Files -->
    <script src="../../igniteui/js/infragistics.core.js"></script>
    <script src="../../igniteui/js/infragistics.dv.js"></script>

  </head>
  <body>
    <!-- Target element for the igSparkline -->
    <div id="sparkline"></div>

    <!-- File supplying the northwindInvoices object for the igSparkline data source -->
    <script src="../../data-files/nw-invoices.js"></script>

    <script>

        $(function () {

            $("#sparkline").igSparkline({
                dataSource: northwindInvoices,
                height: "100px",
                width: "300px",
                valueMemberPath: 'ExtendedPrice',
                labelMemberPath: 'OrderDate',
                normalRangeVisibility: "visible",
                normalRangeMinimum: 200,
                normalRangeMaximum: 600,
                trendLineType: "simpleAverage"
            });

        });
    </script>       

</body>
</html>

我在调试时收到以下错误:

  

SCRIPT1009:预期'}'

     

MyPage.html,第39行第4个字符

enter image description here

1 个答案:

答案 0 :(得分:2)

查看屏幕截图 -

末尾有一个缺少的逗号
 labelMemberPath: 'OrderDate'

这与错误说的完全相同,如果没有逗号,它只能是对象的最后一个属性,因此预计接下来会在第39行用“}”关闭定义。奇怪的是,截图上方的代码看起来是正确的。

相关问题