Redirect to another url when back button is clicked using javascript

后端 未结 4 1772
野趣味
野趣味 2020-12-28 11:14

I have a payment form in which user can enter all his card details,and when he clicks,he is taken to the banks 3D secure page. But,the problem is, the user can simply click

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-28 11:49

    You have to use history api, and for better compatibility use history.js plugin.

    Handling pressing back button :

    $(window).bind('onpopstate', function(e){
       //your dark doings here
    });
    

提交回复
热议问题