刷新后 页面 保持滚动条位置
<SCRIPT LANGUAGE="JavaScript">
<!--
/*haiwa@2004-02-12*/
function Trim(strValue)
{
return strValue.replace(/^\s*|\s*$/g,"");
}
function SetCookie(sName, sValue)
{
document.cookie = sName + "=" + escape(sValue);
}
function GetCookie(sName)
{
var aCookie = document.cookie.split(";");
for (var i=0; i < aCookie.length; i++)
{
var aCrumb = aCookie[i].split("=");
if (sName == Trim(aCrumb[0]))
{
return unescape(aCrumb[1]);
}
}
return null;
}
function scrollback()
{
if (GetCookie("scroll")!=null){document.body.scrollTop=GetCookie("scroll")}
}
//-->
</script>
<BODY id=body onscroll=SetCookie("scroll",body.scrollTop); onload="scrollback();">