try{alert("1");history.go(-5)}
catch(e)
{alert("2");
try{history.go(-4)}
catch(e){
try{history.go(-3)}
catch(e){
try{history.go(-2)}
catch(e){
try{history.back()}
catch(e){alert("3")}}}}}
异常捕获不到只是弹出了1后面就没动静了页面也不返回
哪个大侠给给讲讲这个的异常捕获怎么弄。或者怎么实现这个功能。

解决方案 »

  1.   

     history.go() ResAn error does not occur if the user tries to go beyond the beginning or end of the history. Instead, the user remains at the current page. 如果用户尝试跳转至起止范围之外不会产生错误。取而代之,用户将被留在当前页。
      

  2.   

    至少 ie 下 history.go() 的行为是这样儿滴!
    Web 开发常用手册DHTML 参考手册 -- 参考这里
    http://download.csdn.net/source/308913JScript 语言参考
    http://download.csdn.net/source/308916CCS 样式表中文手册
    http://download.csdn.net/source/304124
      

  3.   

    <script language="javascript">
    try{
    alert("1");
    istory.go("ddd");
    }
    catch(e)
    {alert("2");
    try{history.go(-4);}
    catch(e){
    try{history.go(-3);}
    catch(e){
    try{history.go(-2);}
    catch(e){
    try{history.back();}
    catch(e){alert("3")}}}}}
    </script>
    看看这个地名你就明白了
      

  4.   

     额 我要是能确定准备的url 就不用这么麻烦了。还有其他的方法么
      

  5.   

    返回上一页。
    在B页面有按钮点击后刷新页面的。只是history.back() 不能完全实现。。因为不知道用户点击了几次(最多是5次)。。功能是不管用户点击了几次(0-5),只要点击返回的时候能返回到A页面
      

  6.   

    A页面 的url 有 传值情况。。 所以不能确定a的 具体url
      

  7.   

    服务器端记录用户的转发历史,保存在session里。