Getting data from the browser's console using javascript

前端 未结 1 416
[愿得一人]
[愿得一人] 2020-12-18 04:14

I don\'t know if this has been asked before, but what i\'d like to be able to do is get data from the error console within the browser itself(if it supports it) this would b

相关标签:
1条回答
  • 2020-12-18 04:49

    You can use the onerror event in JS to get the details of the error. Hoptoad do this for example and log the errors to their console, Their code re-uses lots of nice JS scripts including a printStackTrace function that is great.....

    You can see how they do it here:

    http://hoptoadapp.com/javascripts/notifier.js

    0 讨论(0)
提交回复
热议问题