我注意到,当您不将window.location.href绑定到某个事件浏览器时,不会让我返回页面。请解释为什么会这样
let link = document.getElementById('link');
link.addEventListener('click',function(){
window.location.href = "v.html"
})
// the code above works just fine and i can go back in history afterwards
// I can't do the same with the code below
if(1){
window.location.href = "v.html"
}