3 ms·
alert() and confirm() have one feature that no other alert system can match -- the execution of the surrounding script blocks at the calling location.
by spicyj 14y ago
alert() and confirm() have one feature that no other alert system can match -- the execution of the surrounding script blocks at the calling location.
- Drakim 14y agoIndeed, it can be abused as a sort of primitive step-by-step debugging tool.
- zackbloom 14y agoI remember the days before the "Don't allow this site to show more alerts" checkbox when, if you accidentally left an alert in a loop, your only option was Ctrl-Alt-Delete.
- tlrobinson 14y agoYou could even instrument your code to implement a full debugger using "prompt". In fact, I did: https://github.com/tlrobinson/xebug https://github.com/tlrobinson/xebug
- teraflop 14y agoIn at least Firefox and Chrome, you can use the "debugger;" statement to not only block execution, but actually drop into the interactive debugger.