- 论坛徽章:
- 0
|
问题是这样的,为了提高网站显示速度,所以用生成静态页面,再用shtml去include生成的静态页面。
但是在shtml页面中,document.getElementById在<body>中可以显示事先定义的变量,在<title>中则不能,求解决办法,谢谢。以下是相关代码。
-------test.php--------
$a = $xpath->query("/Article/oraDate/RKLSWZBT");
$newszbt = iconv("UTF-8","GB2312",$a->item(0)->nodeValue);
$newspos = unhtmlentities(iconv("UTF-8","GB2312",$a->item(0)->nodeValue));
$newspos = str_replace("$",">>",substr($newspos,1));
document.getElementById('contPostion').innerHTML="当前位置:<?echo $newspos?>正文"
document.getElementById('conttitle').innerHTML="详细-<?echo $newszbt?> "
定义了2个变量,'contPostion'是页面的导航条,'conttitle'是页面的标题。
----------test.shtml------
<div id="contPostion" style="margin-top:12px;margin-left:10px;" align="left">当前位置:</div> ----当前位置可以正常显示导航条
<title><div id="conttitle" style="margin-top:12px;margin-left:10px"; align="left">详细-</div></title> ----title不能正常显示。
求助各位高手,谢谢。
[ 本帖最后由 HonestQiao 于 2006-6-14 10:43 编辑 ] |
|