简体   繁体   English

为什么在这种情况下console.log不起作用

[英]Why does console.log not work in this case

I have this piece of code : 我有这段代码:

e.addEventListener('click', f => {
      console.log(`something ${f}`)
      window.location.replace("/about")
    })

It actually works and takes me to /about but doesn't console log anything 它实际上有效,并带我到/about但没有控制台记录任何内容

The page changes or navigates from one page to another. 页面从一个页面更改或导航到另一页面。 You might need to Preserve Log and it's disabled by default. 您可能需要保留日志,并且默认情况下已禁用它。

保存日志

When the above setting is enabled: 启用以上设置后:

启用

You will be able to see this way. 您将可以看到这种方式。

保存的东西

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM