5 ms·
The use of `document.write` for this entry instead of the usual console threw me off at first.
by syspec 8y ago
The use of `document.write` for this entry instead of the usual console threw me off at first.
- tlrobinson 8y agoPresumably so you can see the output in the embedded JSFiddles. FYI, if you're embedding a JSFiddle you could also just drop this in the HTML section then use console.log: <script>console.log = function(str) { document.write(str, "<br/>") }</script>
- sametmax 8y agoJSFiddle should just have a tick box with "intercept console.log" and a tab with the output .
- tirthbodawala 8y agoHahahaha...It should!
- icc97 8y agoI initially stared at that with horror, but I suspect that Stack Overflow does something similar with their code snippets. If you write console.log it gets output to the screen [0] [0]: https://stackoverflow.com/a/49968603/327074 https://stackoverflow.com/a/49968603/327074
- tazard 8y agoI feel as though this is a missed opportunity to use a proxy!
- 11235813213455 8y agoI lost it at <?php
- yashthakur 8y agoIt is just because since all the JSFiddles are on one page. All the console.log would be together in the console and it would be difficult to know which console is for which code. Hence document.write is used. Though HTML could be used but that would just increase one more tab to show useless HTML. ;)