无法使DataTables与Jade一起使用
我已经写了下面的Jade / Pug模板,但是它并没有启动数据表,我看不到我做错了什么。 有人可以发现这个问题吗?
html head title= 'Feed List' <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> link(href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.0/flatly/bootstrap.min.css", rel="stylesheet") link(href="//cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.css", rel="stylesheet") body div.container.jumbotron h1.header NSE Corporate Announcements h3.header Top Annoucements by corporates listed on NSE div.container script(src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js') script(src='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js') script(src='//cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.js') script. $(document).ready(function() { $('#resultTable').DataTable(); }); div#dataToShow table#resultTable.table.table-hover.datatables tr.head th='Ticker' th='Link' th='Date' th='Description' tbody for feed in feedList tr td= feed.ticker td a(href=feed.attachmentLink) #{feed.ticker} td= moment(feed.dateAdded).format('DD-MM-YYYY HH:MM:SS') td= feed.purposeText
您的网页存在错误。
你错过了标签。 数据表只适用于具有add和tbody的表
解决您的问题是添加标签
html head title= 'Feed List' <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> link(href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.0/flatly/bootstrap.min.css", rel="stylesheet") link(href="//cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.css", rel="stylesheet") body div.container.jumbotron h1.header NSE Corporate Announcements h3.header Top Annoucements by corporates listed on NSE div.container script(src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js') script(src='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js') script(src='//cdn.datatables.net/v/dt/dt-1.10.15/datatables.min.js') script. $(document).ready(function() { $('#resultTable').DataTable(); }); div#dataToShow table#resultTable.table.table-hover.datatables thead tr th Ticker th Link th Date th Description tbody for feed in feedList tr td= feed.ticker td a(href=feed.attachmentLink) #{feed.ticker} td= moment(feed.dateAdded).format('DD-MM-YYYY HH:MM:SS') td= feed.purposeText
- 使用dynamicurl封装标题
- 如何在Gulp-Jade中设置默认的文档types
- 从expres传递数组到jade客户端的javascript
- 在模板中循环,在用玉进行编译时,“无法读取属性长度”的“未定义”错误
- Jade with Express – ReferenceError:窗口未定义
- 来自Jade的sendFile('/ index.html')和render('index')之间的差异
- variables在脚本标记中不可用
- 我的导航菜单有问题。 我正在使用Bootstrap 3,JQuery 2.3.1,Jade,ExpressJS和Node.js
- 错误:input是自我closures,不应该有内容