The browser cannot return to the previous page after js (JavaScript) realizes the jump

        The principle of not being able to roll back is to prevent it from generating historical records.

Methods as below:

1: Define the method.

<script>
        // 跳转页面,且浏览器不能回退到上一级
        function skip() {
            window.location.replace('目标地址')
        }
</script>

2: How to use, take button as an example.

<button onclick="skip()">跳转</button>

3: Success.

Guess you like

Origin blog.csdn.net/m0_59778008/article/details/127125607