Syncfusion JavaScript 网格未显示。语法和引用错误

Syncfusion JavaScript grid not displaying. Syntax and Reference error

我有一个来自 node.js 服务器的 html 页面 运行ning。我正在尝试使用 syncfusion 的基本网格功能,并遵循提供的设置 http://help.syncfusion.com/web

我的代码如下:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta charset="utf-8" />
        <link href="http://cdn.syncfusion.com/js/web/flat-azure/ej.web.all-latest.min.css" rel="stylesheet" />
        <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
        <script src="http://ajax.aspnetcdn.com/ajax/globalize/0.1.1/globalize.min.js"></script>
        <script src="http://borismoore.github.io/jsrender/jsrender.min.js"></script>
        <script src="http://cdn.syncfusion.com/js/web/ej.web.all-latest.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function () {
                window.dataManager = ej.DataManager({
                    url: "http://mvc.syncfusion.com/UGService/api/Orders",
                    crossDomain: true,
                    offline:true
                });
                $("#Grid").ejGrid({
                    dataSource: window.dataManager,
                    allowPaging: true,
                    allowFiltering: true,
                    columns: [
                        { field: "Order", headerText: "Order ID", width: 75, textAlign: ej.TextAlign.Right },
                        { field: "CustomerID", headerText: "Customer ID", width: 80 },
                        { field: "ShipName", headerText: "Ship Name", width: 100 },
                        { field: "ShipCity", headerText: "Ship City", width: 100 },
                        { field: "Freight", width: 80, format: "{0:C3}", textAlign: ej.TextAlign.Right }
                    ]
                });
            });
        </script>
    </head>
    <body>
        <div id="Grid"></div>
    </body>
</html>

<body>
<div id="Grid"></div>
</body>
</html>

我刚刚复制并粘贴并尝试 运行 但出现错误

ej.web.all-latest.min.js:1 Uncaught SyntaxError: Unexpected token ILLEGAL test.html:27 Uncaught ReferenceError: ej is not defined

我已经包含了他们的 ej.js 文件。 第一个错误是此文件的第 1 行 http://cdn.syncfusion.com/js/web/ej.web.all-latest.min.js

这是怎么回事?我想不通:/ 任何帮助都会很棒,因为今天是我开始使用 syncfusion 的第一天,并且没有太多文档可以帮助您进行设置...

http://cdn.syncfusion.com/js/web/ej.web.all-latest.min.js 是一个没有 HTTP headers 的 gzip 资源,它会向浏览器解释,以便它为您解压缩。

简而言之,该文件的托管版本已损坏。从其他地方找到一个干净的版本(或使用 wget 下载并手动 gunzip)并将其托管在其他地方。

ej.web.all-latest.min.js 的 cdn link 中报告的问题现已修复。现在您可以在示例中使用相同的 cdn link

此致,

苏尼尔·普拉巴卡 [Syncfusion 团队]