Preventing infinite alert loops in Javascript

I found this code snippet which overrides the window.alert function to prevent an infinite loop.

window.alert = function(s) {
if(!confirm(s))
window.alert = null;
}

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *