Javascript / jQuery back button - so long as last page was part of current site?

前端 未结 2 906
感情败类
感情败类 2021-02-04 18:22

With the code below I can make a \'back\' button, but is there a way of making the link require that the last page was part of the current site?

$(document).rea         


        
2条回答
  •  你的背包
    2021-02-04 19:09

    Please don't do this.

    But you could use a cookie

    psuedo code

    if !cookie_exists()
        disable_back_button()
        create_cookie()
    

    Then delete the cookie when the user leaves.

    Referrer can be edited, so I don't recommend that

    but I also don't recommend doing this at all, its annoying.

提交回复
热议问题