Override window.alert
For years the only bit of feedback web developers could get was via alert("{str}")
calls. These days we have the web console but, in rare cases, we don't have a console and alert
calls are our only window into a value at a given time.
One problem: if an alert
sneaks into production code, your site looks like it's been hacked. Your site looks like it's malware! To prevent any of those issues, you can add this snippet to your production build:
window.alert = console.log
This tiny line of JavaScript could save your site from catastrophe. There are many cases for overriding native functionality and this is a great example!
When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It." Can you blame us though? We watched the fundamental APIs stagnate for so long that a basic feature...
Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...
Recently I was asked to create a user interface that allows someone to upload an image
to a server (among other things) so that it could be used in the various web sites my
company provides to its clients. Normally this would be an easy task—create a...
When I first wrote MooTools ElementFilter, I didn't think much of it. Fast forward eight months later and I've realized I've used the plugin a billion times. Hell, even one of the "big 3" search engines is using it for their maps application.
it’s an interesting idea, and I’m not saying the world is perfect, but if instead of using this to avoid pushing debug code onto production, how would I go about testing for stuff like alerts and other weird edge cases
In older IE browsers the browser will crash if console.log is called when the debug window is closed. Will this work then?
override window.alert in IE for logggint using $.ajax to call WebService or REST API ?