页面上有一返回按钮,功能与浏览器的后退一样,代码:history.go(-1)
但现在有个问题,用户多点几次后会最终返回到登录页面,体验感不好,
有没有方法能控制这种情况?当要返回的页面是登录页面时,则不跳转!
或者用其他方法来实现返回后退的功能 ?谢谢!

解决方案 »

  1.   

    返回按钮直接指定返回界面,不推荐用history.go(-1)
      

  2.   

    记录原页面的url地址啊
      

  3.   

    直接写个事件回原来的url啊!
      

  4.   

    不要这么用,直接写跳转的URL
      

  5.   

    记录session当用户返回登陆页时,判断session不为空时,跳转至首页!
      

  6.   

    NO
    u cannot do that because using history.go(-1) is the same as clicking the back button in IE, and it has no idea what's the target page is.Use url directly, and it should an easy issue.
      

  7.   

    当要返回的页面是登录页面时 你不用history.go(-1) 就OK了。
      

  8.   

    Session 也就是一次会话中 你要返回的ID还能拿到。
      

  9.   

        你可以直接返回到url;或者是你记录返回页的url然后与登陆页面比较,如果是就让它停在最后一次返回的页面上,如果不是就让它再返回呗!