showModalDialog 父窗口 下拉条位置记住 没有记住哦,这样的代码。
showModalDialog 打开子窗口后,在关闭字窗口,父窗口的下拉条位置会跑到顶部,有没有办法记住呢。关闭子窗口,父窗口没刷新。<script language= "javascript ">
function newsearch(murl,width,height) //为状态提供打开页面
{
murl = encodeURI(murl);
var obj = window.showModalDialog(murl,window,"dialogWidth="+width+"px;dialogHeight="+height+"px;resizable=yes;status=no;help=no;");
//window.location.href =window.location.href; //刷新父窗口
//window.location.reload();
}
</script>
<script language= "javascript ">
function GetCookie (name)
{
var arg = name + "= ";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf( " ", i) + 1;
if (i == 0) break;
}
return null;
}
function getCookieVal (offset)
{
var endstr = document.cookie.indexOf ( "; ", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie (name, value)
{
document.cookie = name + "= " + escape (value)
}
</script>
<body bgColor= "#f1f5f5 " leftMargin= "0 " topMargin= "0 " rightMargin= "0 " MS_POSITIONING= "GridLayout " onload= "document.body.scrollTop=GetCookie( 'posy ') " onunload= "SetCookie( 'posy ',document.body.scrollTop) ">