直接调用系统的 command 命令.

解决方案 »

  1.   

    你可以先用COOKIES来记住当前网页所在document.body.scrollTop属性的值,再执行刷新,然后在新的网页载入时先取得COOKIES信息,再移动到COOKIES所对应的值信息
      

  2.   

    用 cookie 记录滚动条的位置, 用 cookie 感觉总不太好.
    <script language=javascript>
    function setCookie(name,value)
    {
        var Days = 2; //此 cookie 将被保存 2 分钟
        var exp  = new Date();    //new Date("December 31, 9998");
            exp.setTime(exp.getTime() + Days*60*1000);
            document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
    }
    function getCookie(name)
    {
        var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
            if(arr=document.cookie.match(reg)) return unescape(arr[2]);
            else return null;
    }
    function window.onbeforeunload()
    {
       var a = document.body.scrollTop;
       var b = document.body.scrollLeft;
       if (a == 0 && b == 0)
          setCookie("meizz", wlh +"@"+ a +"@"+ b);
    }
    function window.onload()
    {
       var s = getCookie("meizz");
       if (s)
       {
           s = s.split("@");
           if (wlh == s[0])
           {
              document.body.scrollTop  = s[1];
              document.body.scrollLeft = s[2];
           }
       }
    }
    var wlh = window.location.href;
    wlh = wlh.substring(wlh.lastIndexOf("/")+1, wlh.length);
    </script>