如何在HTML文档中包含文件 [英] How to include a file in an HTML doc

查看:78
本文介绍了如何在HTML文档中包含文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:在特定位置的HTML文档中插入文件内容。


一种可能的方法是添加这样的WebCharm标记:


<%@ charm:text 20 0 my_include_file.txt%>


当WebCharm感知的Web服务器处理HTML模板时,

my_include_file.txt的内容插入标签位置。


这项工作非常类似于SSI #include标签。但是,你对my_include_file.txt的缓存方式有更多的控制权。在上面的示例中,文件最初被缓存

,然后在标记处理20次后获取。也就是说,每20个请求获取一次。

标记缓存(和模板缓存)在服务器期间提高页面生成速度

响应。


访问edgesoft.ca网站以获取有关WebCharm模板和标签的更多信息。

特别是, www.edgesoft.ca/go/index.html?top=wc


-

Long On

Edgesoft Consulting Inc.

webcharmer @ www.edgesoft.ca/go/member/index.html
www.edgesoft.ca/go/index.html
www.edgesoft.ca

Problem: to insert the content of a file in an HTML document at a specific location.

One possible way is to add a WebCharm tag like this:

<%@charm:text 20 0 my_include_file.txt %>

When the HTML template is processed by a WebCharm-aware web server, the
content of my_include_file.txt is inserted at the tag location.

This work very much like the SSI #include tag. However, you have more control
on how my_include_file.txt is cached. In the above example, the file is initially cached
and then fetched after the tag is processed 20 times. That is, fetched once per 20 requests.
Tag caching (and template caching) increases page generation speed during server
response.

Visit edgesoft.ca web site for more information on WebCharm template and tags.
In particular, www.edgesoft.ca/go/index.html?top=wc

--
Long On
Edgesoft Consulting Inc.
webcharmer @ www.edgesoft.ca/go/member/index.html
www.edgesoft.ca/go/index.html
www.edgesoft.ca


推荐答案

有时候2003年10月22日星期三02:27:29格林尼治标准时间,据报道Long已经说明了:b $ b />
Sometime around Wed, 22 Oct 2003 02:27:29 GMT, Long is reported to have
stated:
问题:在特定位置的HTML文档中插入文件内容。
Problem: to insert the content of a file in an HTML document at a specific location.




解决方案: http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another


-

Mark Parnell
http://www.clarkecomputers.com.au


文章< lW ******** ********@news01.bloor.is.net.cable.roge rs.com>,无数猴子之一

键盘上的Long <螺*********** @ rogers.com>写道:
In article <lW****************@news01.bloor.is.net.cable.roge rs.com>, one of infinite monkeys
at the keyboard of "Long" <lo***********@rogers.com> wrote:
问题:在特定位置的HTML文档中插入文件的内容。


很久以前就解决了。有很多可用的解决方案。

一种可能的方法是添加这样的WebCharm标签:

<%@ charm:text 20 0 my_include_file.txt%>


只要某个处理器不可用,解决方案就会破解,这是一个糟糕的解决方案。当某个处理器是一个特定的实现时,两个处理器是一个特定的实现,而不是一个开放的规范。

这个工作非常像SSI #include标签。


不。如果处理器不可用,SSI不会破坏HTML(或XML)。

但是,你对my_include_file.txt的缓存方式有更多的控制权。


你有更多*​​有用*控制XBitHack。

在上面的例子中,文件最初被缓存
然后在标签后获取处理20次。


这是一个令人难以置信的无关紧要的缓存标准!

标签缓存(和模板缓存)可以在服务器响应期间提高页面生成速度。


嗯,是的。是的(至少只要你的发动机的开销比储蓄少了多少b / b),但绝不是新的。

访问edgesoft.ca web
Problem: to insert the content of a file in an HTML document at a specific location.
Long ago solved. Many solutions available.
One possible way is to add a WebCharm tag like this:

<%@charm:text 20 0 my_include_file.txt %>
A solution that breaks as soon as some-processor is not available is a poor
solution. Doubly so when some-processor is a specific implementation
as opposed to an open spec.
This work very much like the SSI #include tag.
Nope. SSI doesn''t break HTML (or XML) if the processor is not available.
However, you have more control
on how my_include_file.txt is cached.
You have more *useful* control with XBitHack.
In the above example, the file is initially cached
and then fetched after the tag is processed 20 times.
What a mindbogglingly irrelevant criterion for cacheing!
Tag caching (and template caching) increases page generation speed during server
response.
Erm, yes. True (at least so long as the overhead of your engine is less
than the saving), but by no means new.
Visit edgesoft.ca web




现在这很有趣。您的名字与Edge-Side相似吗

包括纯粹的巧合?猜猜我什么时候可以看看

获得一个网络连接。


-

Nick Kew


迫切需要付费工作 - 请参阅 http://www.webthing.com/~nick/cv.html




"尼克基尤 < NI ** @ fenris.webthing.com>在消息新闻中写道:ru *********** @ jarl.webthing.com ...

:文章< lW ********** ****** @ news01.bloor.is.net.cable.roge rs.com>,无限猴子之一

:在Long的键盘上<螺*********** @ rogers.com>写道:

:>问题:在特定位置的HTML文档中插入文件内容。



:很久以前解决了。提供多种解决方案。



:>一种可能的方法是添加如下的WebCharm标签:

:>

:> <%@ charm:text 20 0 my_include_file.txt%>



:只要某个处理器不可用就会中断的解决方案很差

:解决方案。当某个处理器是一个特定的实现时,这是双重的,而不是一个开放的规范。



我们认为这不是很多关注,因为它应该与

a处理器(WebCharm)一起使用,否则就没有意义了。但是,

不难修改标签看起来像:


<! - @ charm:text 20 0 my_include_file.txt @ - - >


我们会在下一个版本中考虑它。


:>这项工作非常类似于SSI #include标签。



:不。如果处理器不可用,SSI不会破坏HTML(或XML)。



:>但是,你有更多的控制权

:>关于如何缓存my_include_file.txt。



:你有更多*​​有用*控制XBitHack。



:>在上面的示例中,文件最初是缓存的

:>然后在标签处理20次后获取。



:缓存无关紧要的标准!



考虑模板和标签已缓存,并且您已更新.txt文件

内容。你如何解除缓存并强制重新加载?


:>标签缓存(和模板缓存)可提高服务器期间的页面生成速度

:>回复。



:呃,是的。是真的(至少只要你的发动机的开销少于储蓄),但绝不是新的。



:>访问edgesoft.ca网站



:现在这很有趣。您的名字与Edge-Side的名称相似吗

:获得网络连接。



从未听说过ES I.你能提供链接吗?





: -

:Nick Kew


:迫切需要付费工作 - 请参阅 http://www.webthing.com/~nick/cv.html


这篇关于如何在HTML文档中包含文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆