如何解决jQuery表将无法加载,无法加载资源
我正在为自己的课程制作一张表,但是无法加载数据表中的精美表,我只是在获取一个无聊的旧html表。
我在书中浏览了一下代码,看起来似乎是相同的。仍然即时通讯出现错误
Failed to load resource: net::ERR_FILE_NOT_FOUND
我不知道出了什么问题。 这是代码
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="C:\Users\bas_t\OneDrive\Code Educom\JQuery\JQuery\style.css"/>
<link rel="stylesheet" href="//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"/>
<script src="js/jquery.js" />
<script src="//cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"/>
<script>
$(document).ready( function() {
$('#theBeatles').DataTable();
})
</script>
</head>
<body>
<table id="theBeatles"
class="display nowrap dataTable dtr-inline collapsed">
<thead>
<th>Name</th>
<th>Email</th>
<th>Instrument</th>
</thead>
<tbody>
<tr>
<td>John Lennon</td>
<td>john@thebeatles.co.uk</td>
<td>Guitar</td>
</tr>
<!-- and so on with the other members -->
</tbody>
</table>
</body>
</html>
解决方法
您的HTML无效,CSS的文件路径可能无效
做这些事
- 删除自动关闭脚本标签并转换为
<script> your file </script>
-Why? - 您正在尝试加载本地CSS文件-可能无法正常工作,请尝试从本地服务器提供文件-我可能建议serve或将CSS文件的值粘贴到
<style>
中标签
祝你好运!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。