zjrJS Javascript Library

zjrJS.Debug.alert() - zjrJS Javascript Library

This information lives on a webpage hosted at the following web address: 'https://omegajunior.globat.com/code/zjrjs/'.

How to use zjrJS.Debug.alert()

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