Alert Box Protection

Often when working on scripts alert boxes are placed inside loops as a deb***ing tool. You can sometimes end up with hundreds of alert boxes and no way to stop them. This [URL="http://www.javascript****.com/javascript/"]JavaSc... [URL="http://www.javascript****.com/alert-box-protection.html/en//"]detail[/URL]

[URL="http://www.javascript****.com/alert-box-protection.html/en/"][IMG]http://www.javascript****.com/javascript.images/misc/alert-box-protection.jpg[/IMG][/URL]
Demo: [URL="http://www.javascript****.com/javascript/misc/alert-box-protection/preview/en/"]Alert Box Protection[/URL]

How to setup

Step *: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Code:
<script type=text/javascript>
//Created by: Benjamin Joffe :: http://www.abrahamjoffe.com.au/ */

(function(){
  var a=window.alert, c=0;
  window.alert=function(q){
    // Change the number below to the number of alert boxes to display before the warning is given.
    if (++c%5==0) {
      if (!confirm(q+'\nThere have been '+c+' alert boxes, continue displaying them?')) window.alert=function(){};
    } else a(q);
  }
})();

// This is only a test case. You can removed it.
function testing() {
	for (var i=*; i<50; i++) {
	  alert('This is an annoying loop of 50 alerts.\nEvery 5th alert you will have an option to exit.\n\n'+i);
	}
}


</script>
	<!--
    	This script downloaded from www.JavaScript****.com
    	Come to view and download over 2000+ free javascript at www.JavaScript****.com
	-->
Step 2: Place HTML below in your BODY section
HTML
Code:
<input type="submit" value="Press to test" onclick="testing();">
	<!--
    	This script downloaded from www.JavaScript****.com
    	Come to view and download over 2000+ free javascript at www.JavaScript****.com
	-->





[URL="http://www.javascript****.com/floating-message-scroller.html"]Javascript floating message[/URL] - [URL="http://www.javascript****.com/javascript-multi-level-drop-down-menu.html"]Javascript multi level drop down menu[/URL] - [URL="http://www.javascript****.com/in-array.html"]JavaScript in_array()[/URL]