gpt4 book ai didi

javaScript 运行时错误 : 'kendo' is undefined

转载 作者:行者123 更新时间:2023-11-30 00:25:44 25 4
gpt4 key购买 nike

我有一个使用 kendo grid 的应用程序,当我尝试运行该应用程序时,出现此错误

JavaScript runtime error: 'kendo' is undefined

下面是我的代码。我需要在哪里定义剑道?

<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.common.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.default.min.css" />

<script src="http://cdn.kendostatic.com/2015.2.624/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2015.2.624/js/kendo.all.min.js"></script>


<div id="rpViewContent" class="view-content">
<div id="purchdGrid"
data-role="grid"
data-resizable="true"
data-navigatable="true"
data-editable="true"
data-pageable="false"
data-columns="[
{ 'field': 'PO', 'title': '<b>PO #', 'width': 65 },
{ 'field': 'Line', 'title': '<b>Line #', 'width': 65 },
{ 'field': 'Item', 'title': '<b>Item #', 'width': 65 },
]"
data-bind="source:purchDataSource"
style="height: 55%">
</div></div>
<script>
var viewModel = kendo.observable({
purchDataSource: new kendo.data.DataSource({
schema: {
model: {
id: "ID",
fields: {
Line: { type: "string" },
Item: { type: "string" }
}
}
},
data: [
{ ID: "43824", Line: "1", Item: "Thus is a test 1" },
{ ID: "43825", Line: "2", Item: "Thus is a test 2" },
{ ID: "43826", Line: "3", Item: "Thus is a test 3" }
]
})
});
kendo.bind($("#purchViewContent"), viewModel);
</script>

最佳答案

此代码段显示了一个有效的 Kendo 对象,请确保您的链接和脚本标记位于 HTML 文档中的正确位置。

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.common.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.default.min.css" />
</head>
<body>
<script src="http://cdn.kendostatic.com/2015.2.624/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2015.2.624/js/kendo.all.min.js"></script>
<script>
console.log(kendo);
</script>
</body>
</html>

关于javaScript 运行时错误 : 'kendo' is undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31516751/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com