如何将html文本文件分成多个文件?
问题描述:
关于 html 的非常基本的问题.
Very basic question about html.
因为太长,想把文件分成多个文件.这不是关于使用 iframe 等,而只是想包含多个文本文件来创建 html 文件的
.
Because the <body>
is too long, I want to divide the file into multiple files. It is not about using iframe etc, but just want to include multiple text files to create <body>
of the html file.
谢谢!
答
你可以用 jquery 做到这一点
You can do it using jquery
<head>
<script src="jquery.js"></script>
<script>
$(function(){
$("#Contenttoinclude").load("b.txt or b.html");
});
</script>
</head>
并将其加载到 html
and load it in html
<body>
<div id="Contenttoinclude"></div>
</body>