javascript - Which error events do no trigger window.onerror? - Stack Overflow

MDN states the following:somemany error events do not trigger window.onerror, you have tolisten for t

MDN states the following:

some/many error events do not trigger window.onerror, you have to listen for them specifically

That's great, but which ones do not invoke onerror?

MDN states the following:

some/many error events do not trigger window.onerror, you have to listen for them specifically

That's great, but which ones do not invoke onerror?

Share Improve this question edited Jan 2, 2022 at 23:58 0Valt 10.4k9 gold badges39 silver badges64 bronze badges asked Dec 14, 2012 at 21:22 FranciscFrancisc 80.6k65 gold badges185 silver badges278 bronze badges 3
  • 2 If a program cannot be parsed, then you get a SyntaxError before the onerror assignment can even be evaluated. – pimvdb Commented Dec 14, 2012 at 21:27
  • Let's assume that the first script loaded only has window.onerror=function(){console.log(arguments);}; and nothing more. – Francisc Commented Dec 14, 2012 at 21:28
  • 1 I assume that bit in the MDN docs refers to loading error events for Ajax, images, etc. – apsillers Commented Dec 14, 2012 at 21:32
Add a ment  | 

1 Answer 1

Reset to default 5

It looks like quirksmode has a good detail of what errors it will and will not catch: http://www.quirksmode/dom/events/error.html

If it helps, any error that you specifically throw will be caught.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744854518a4597328.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信