gpt4 book ai didi

javascript - Bootstrap 表在控制台中给出错误

转载 作者:行者123 更新时间:2023-12-02 16:42:11 25 4
gpt4 key购买 nike

我是 Bootstrap 表新手。正在尝试使用 Bootstrap 表文档来构建一个非常基本的表。

目前我指的是http://bootstrap-table.wenzhixin.net.cn/examples/

我尝试包含 jquery、bootstrap 和 bootstrap-table 脚本文件以及文档中提到的 css。

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Bootstrap Table CSS -->
<link href="css/bootstrap-table.min.css" rel="stylesheet" >

脚本文件:

<!--Jquery-->
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<!--Bootstrap-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>\
<!--Bootstrap Tables-->
<script type="text/javascript" src="js/bootstrap-table.min.js"></script>

并包含 HTML 代码:

<table id="table">
<thead>
<tr>
<th data-field="name">Name</th>
<th data-field="stargazers_count">Stars</th>
<th data-field="forks_count">Forks</th>
<th data-field="description">Description</th>
</tr>
</thead>
</table>

使用Javascript加载数据。

var data = [
{
"name": "bootstrap-table",
"stargazers_count": "526",
"forks_count": "122",
"description": "An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3) "
},
{
"name": "multiple-select",
"stargazers_count": "288",
"forks_count": "150",
"description": "A jQuery plugin to select multiple elements with checkboxes :)"
},
{
"name": "bootstrap-show-password",
"stargazers_count": "32",
"forks_count": "11",
"description": "Show/hide password plugin for twitter bootstrap."
},
{
"name": "blog",
"stargazers_count": "13",
"forks_count": "4",
"description": "my blog"
},
{
"name": "scutech-redmine",
"stargazers_count": "6",
"forks_count": "3",
"description": "Redmine notification tools for chrome extension."
}
];

$(function () {
$('#table').bootstrapTable({
data: data
});
});

但是我在控制台上收到以下错误:

Error on Console请在这件事上给予我帮助。谢谢

最佳答案

写这个

<script type="text/javascript" src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>

而不是

<script type="text/javascript" src="js/bootstrap-table.min.js"></script>

Bootstrap-table 的 JS 已更改。

关于javascript - Bootstrap 表在控制台中给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27396628/

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