是否有任何命令可以在HTML文档中调用此文本文件中的内容,因此文本文件中的内容导入调用的地方,每次显示时都显示?
示例:?????/ test.txt?解决方案我相信你的意思是询问是否存在一个允许包含文件的HTML命令。
纯HTML本身并不存在,但Apache 服务器端包含的确提供了这样的指示:
<! - #include virtual =./ test.txt - >您将需要通过Web服务器启用SSI处理。在Apache中,你通常会调用你的文件 .shtml 或类似的东西。
Say I have a text file (test.txt) that contains only the following line:
<h1>Text text text text text</h1>Is there any command that I can call the contents from this text file in an HTML document, so the contents in the text file imports where the call is made, every time the side shows?
Example: ?????"/test.txt"?????
解决方案I believe you mean to ask whether there exists a "command" in HTML which allows you to include a file.
In pure HTML by itself there does not, but the Apache server-side includes does provide such a directive:
<!--#include virtual="./test.txt" -->You will need to enable SSI processing by your webserver. In Apache, you'd typically call your file .shtml or something like that.
更多推荐
将extarnal文件中的代码导入到HTML中
发布评论