Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一个可以在触发错误时使用的钩子。我知道您可以尝试/捕获,但我想要像 jQuery 的 .error 但绑定到所有错误的东西。
有人知道这样的事情吗?
也许这就是您正在寻找的window.onerror
概括 运行时脚本错误的事件处理程序。 请注意,一些/许多错误事件不会触发 window.onerror,您必须专门监听它们。
概括
运行时脚本错误的事件处理程序。
请注意,一些/许多错误事件不会触发 window.onerror,您必须专门监听它们。