Visitar URL original
onbeforeunload章节中已过时的警告提示信息 · Issue #1219 · javascript-tutorial/zh.javascript.info · GitHub
Skip to content

onbeforeunload章节中已过时的警告提示信息 #1219

Description

@imnotananga

位置:
https://zh.javascript.info/onload-ondomcontentloaded#window.onbeforeunload

event.preventDefault() 在 beforeunload 处理程序中不起作用 这一部分的警告提示信息已过时
经测试,event.preventDefault()是正常起作用的,查看了下俄文原版教程,这一段内容也已经删除了

截屏2024-08-08 14 59 00

测试环境:
Chromium Engine Version 127.0.6533.89
Safari 版本17.5 (19618.2.12.11.6)

建议:
同步删除该部分内容

Activity

  1. GeoDaoyu commented on Nov 17, 2025

    @GeoDaoyu
    Contributor
  2. imnotananga commented on Nov 24, 2025

    @imnotananga
    Author

    英文原版教程中的确还有这部分内容,我以前误以为俄文版是原版,刚看了下俄文版其实是翻译版,可能翻译的时候没有补充这块。
    不过我又尝试了下,event.preventDefault()依然是有效的,感觉是现代浏览器为了兼容已经支持了。

  3. GeoDaoyu commented on Nov 24, 2025

    @GeoDaoyu
    Contributor

    要不然先给 https://github.com/javascript-tutorial/en.javascript.info/issues 提issue,然后中文版这边再同步?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions