【问题标题】:Syncfusion JavaScript grid not displaying. Syntax and Reference errorSyncfusion JavaScript 网格未显示。语法和引用错误
【发布时间】:2015-03-10 16:02:39
【问题描述】:

我有一个从 node.js 服务器运行的 html 页面。我正在尝试使用 syncfusions 基本网格功能,并按照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 文件。 第一个错误是这个文件的第一行http://cdn.syncfusion.com/js/web/ej.web.all-latest.min.js

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

【问题讨论】:

    标签: javascript syncfusion


    【解决方案1】:

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

    问候,

    苏尼尔·普拉巴卡尔 [同步​​融合团队]

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-25
        相关资源
        最近更新 更多