+ 6

[JS] Prevent error console from getting too busy with timers [TIP]

<script> tags share context but run independently, so you can step on your own feet if a timer interacts with a console. You may want to cancel timers on first error: [HTML] <head> <!-- Own block, ideally imported as the first script --> <script>window.onerror = function() { halt() } </script> <!-- [JS] auto-insertion point --> </head> [JS] function frame(timestamp) { // return if halt=true, or... } // ...cancel function halt() { stopAnimationFrame / clear Timeout/Interval }

13th Jul 2017, 11:52 PM
Kirk Schafer
Kirk Schafer - avatar
1 ответ
+ 1
xorry no idea
20th Jul 2017, 6:28 PM
stephen haokip
stephen haokip - avatar