如何将现有的Title标记作为textonly拉入文档正文 [英] How to pull existing Title tag into the body of the document as textonly

查看:65
本文介绍了如何将现有的Title标记作为textonly拉入文档正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够拉出当前的< Title>标题从标题转换为

html页面的正文。我们开始用php编写代码,我们

能够让它运行起来。然而,整个页面正在被解析

并且真正使系统陷入困境并且页面加载速度非常慢。

(系统是Dual P4 2.4,1GB ram,Redhat 9.0)

为了解决这个问题,我们决定只使用javascript,效果很好。

立即加载文本。但是,搜索引擎不会处理

javascript,因此该文件将无法在扫描的文件中显示。

有没有人有办法从文档中提取标题标签并在文档中显示其内容仅为文本,而无需加载

系统?当我们尝试它时,页面花费的时间比没有代码的时间长至少5倍。


任何反馈都会非常感激。非常感谢。

I need to be able to pull the current <Title> tag from the header into
the body of the html page. We started coding this with php, and we
were able to get it working. However the entire page is being parsed
and really bogging down the system and the pages load very slowly.
(the system is Dual P4 2.4, 1GB ram, Redhat 9.0)
To fix this we decided to just use javascript, which worked great.
Text loaded immediately. However, search engines will not process the
javascript, thus this text will not be available in the document to be
scanned.
Does anyone have a way to pull a title tag from a document and display
its content as text only within a document, Without loading down the
system? When we tried it, it took the pages at least 5 times longer to
load than without the code.

Any feedback at all would be greatly appreciated. Thanks very much.

推荐答案

*** Mike写道/escribió(周四,2004年8月5日05:08:49 GMT):
*** Mike wrote/escribió (Thu, 05 Aug 2004 05:08:49 GMT):
有没有人有办法从文档中提取标题标签并将其内容显示为仅在文档中的文本,而无需加载
系统?当我们尝试它时,加载页面的时间至少比没有代码要长5倍。
Does anyone have a way to pull a title tag from a document and display
its content as text only within a document, Without loading down the
system? When we tried it, it took the pages at least 5 times longer to
load than without the code.




我不确定你的确切要求,但最简单的解决方案似乎是
使用变量:


< ;?



I''m not sure of your exact requirements but the easiest solutions seems to
use a variable:

<?


title ='''Foo'';

?>

< html>

< head>

< title><?=
title=''Foo'';
?>
<html>
<head>
<title><?=


title?>< / title>

< / head>

< ; body>

< p>此页面为<?=
title?></title>
</head>
<body>
<p>This page is "<?=


这篇关于如何将现有的Title标记作为textonly拉入文档正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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