zjrJS.Debug.alert() - Stable Test Suite for zjrJS

This information lives on a webpage hosted at the following web address: 'https://www.omegajunior.net/code/zjrjs/stable.php'.

How to use zjrJS.Debug.alert()

Used zjrJS Version:

Stable Minified version 20141202t2322 of zjrJS.


 

Declaration
zjrJS.Debug.alert(String)

Goal
If Debug.mode != 0, the passed String is alerted using a standard window.alert(). This improves window.alert(), because you can leave your debug messages in your coding, and simply switch alerting on or off.

Typical usage
One would put alerts all over the place in their programming. Then switching Debug.mode would turn alerting on or off. That switch can be a configuration setting, or the result of pushing a button.

Member Type
Method (no return value).

Parameters
String - whatever piece of text you wish to have alerted.

Dependencies
zjrJS.Debug.mode

Example
<script type="text/javascript" src="zjrJS.version.js" id="zjrJS"></script>
<script type="text/javascript">/* <![CDATA[ */
var D = zjrJS.Doc;
D.aE(window, "load", function () {

//Switch on alerting
zjrJS.Debug.mode = 1;

//Shout out
zjrJS.Debug.alert( "Hello, world!" );

});
D=null;
/* ]]> */</script>

Download:

Download zjrJS’ latest stable build (20141202t2322) minified (7.1KB).

Download zjrJS’ latest stable build (20141202t2322) (11.9KB).

Clicky Analytics