源代码:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="/">
<html xmlns="http://www.w3.org/TR/WD-xsl">
<head>
<title> </title>
<script type="text/javascript">
function initial()
{
var height=document.documentElement.clientHeight;
document.getElementById("userinfo").style.height=height+"px";
}
</script>
</head>
<body onload="initial()">
<div id="userinfo" style="width: 179px; float: left; border-right: 1px solid #999999;"> 数据挖掘交友
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
上面这段代码在执行时,页面上总是报脚本错误:document.getElementById()参数错误。想了半天不知道为什么,请各位高手指点一二。错了,发现原来是document.documentElement.clientHeight出错。
那么在这里应该用什么方法得到浏览器当前高度呢?Create By Any-Extract(WL-AE)
数据挖掘交友