gpt4 book ai didi

jquery - 无法在jsp中创建jtable

转载 作者:行者123 更新时间:2023-12-01 01:34:58 25 4
gpt4 key购买 nike

嗨,我想在 jsp 中创建一个 jtable,经过大量谷歌搜索后,我找到了这个网站,因为这个网站说我将有一个默认表,但当我运行它时,我得到一个空白页面。请帮助我 http://jtable.org/GettingStarted#ListAction

   <html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<!-- Include one of jTable styles. -->
<link href="/jtable/themes/metro/blue/jtable.min.css" rel="stylesheet" type="text/css" />

<!-- Include jTable script file. -->
<script src="/jtable/jquery.jtable.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function () {
$('#PersonTableContainer').jtable({
title: 'Table of people',
actions: {
listAction: '/GettingStarted/PersonList',
createAction: '/GettingStarted/CreatePerson',
updateAction: '/GettingStarted/UpdatePerson',
deleteAction: '/GettingStarted/DeletePerson'
},
fields: {
PersonId: {
key: true,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
RecordDate: {
title: 'Record date',
width: '30%',
type: 'date',
create: false,
edit: false
}
}
});
});
</script>
</head>
<body>
<div id="PersonTableContainer"></div>
</body>
</html>

最佳答案

enter image description here

<html>
<head>

<script src="https://raw.github.com/akashshinde/project/master/scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="https://github.com/akashshinde/project/raw/master/scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>

<!-- Include one of jTable styles. -->

<link href="https://raw.github.com/akashshinde/project/master/themes/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
<link href="https://raw.github.com/akashshinde/project/master/scripts/jtable/themes/lightcolor/blue/jtable.css" rel="stylesheet" type="text/css" />

<!-- Include jTable script file. -->
<script src="https://raw.github.com/akashshinde/project/master/scripts/jtable/jquery.jtable.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#PersonTableContainer').jtable({
title: 'Table of people',
actions: {
listAction: '/GettingStarted/PersonList',
createAction: '/GettingStarted/CreatePerson',
updateAction: '/GettingStarted/UpdatePerson',
deleteAction: '/GettingStarted/DeletePerson'
},
fields: {
PersonId: {
key: true,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
RecordDate: {
title: 'Record date',
width: '30%',
type: 'date',
create: false,
edit: false
}
}
});
});
</script>
</head>
<body>
<div id="PersonTableContainer"></div>
</body>
</html>

实际上 javascript 文件没有正确加载到您的 jsp 文件中因此,正如我在上面的代码中输入的那样,在 url 中正确导航 .js 文件。

Just replace code with your code

关于jquery - 无法在jsp中创建jtable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16535126/

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