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!
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
Regardless of your stance on pornography, it would be impossible to deny the massive impact the adult website industry has had on pushing the web forward. From pushing the browser's video limits to pushing ads through WebSocket so ad blockers don't detect them, you have...
A few of my customer have asked for me to create a subtle but dynamic (...I know...) way for them to advertise different specials on their website. Not something that would display on every page, but periodically or only the homepage. Using a trick...
The ability to create rounded corners with CSS opens the possibility of subtle design improvements without the need to include images. CSS rounded corners thus save us time in creating images and requests to the server. Today, rounded corners with CSS are supported by all of...
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 ?