Menu

Tech tip - overriding 'alert' to write to 'console.log' in JavaScript

I define my own global function 'alert' that writes the message using 'console.log'.

I still use 'alerts' for debugging. I can leave the alerts in when going live and just override the 'alert' function.

I also still debug by adding colored backgrounds to HTML elements.

The debugger on my old Konqueror browser hangs the browser. The browser is 15 years old and I compiled it myself (slightly wrongly) from the sources.

There are more tips at: bbingo.xyz/t

Posted by Bert Beckwith 2025-11-01 | Draft

Log in to post a comment.