Common Javascript alerts methods

So here are some common javascript message alerts methods (common texts, variable values and lengths) widely used for testing and debugging.

There are also some useful methods with displaying alerts on condition and with returning values.

// Common javascript alert methods
var C = {
    A: function (AlertMessage) {
    alert(AlertMessage);
},
Av: function (AlertMessage, AlertValue) {
    alert(AlertMessage + " = " + AlertValue);
},
Ar: function (ReturnValue, AlertMessage) {
    alert(AlertMessage);
    return ReturnValue;
},
Al: function (AlertMessage, AlertValueLength) {
    alert(AlertMessage + " = " + AlertValueLength.length);
},
Ai: function (AlertOnTrueCondition, AlertMessage, AlertValue) {
    if (!AlertOnTrueCondition)
        return;

    if (AlertValue !== undefined)
        alert(AlertMessage + " = " + AlertValue);
    else
        alert(AlertMessage);
}
};

Usage is very simple :

C.A("My test message");  // alert message
C.Al("My val length", MyVal);  // display MyVal length
C.Av("My val value", MyVal);  // display MyVal value
return C.Ar(MyVal, "My Test message");  //  display message and return MyVal

Common javascript for web pages

Here goes some basic Javascripts common web pages scripts to run methods on document ready and window loaded with try catch condition and optional on error message display (for debugging scripts).

These scripts use common methods from Jquery.min library for maximum cross browser functionality.

// Common javascript web pages
var C = {
    T: function (MethodToTryCatch, CustomErrorMessage) {
        if (MethodToTryCatch === undefined)
            return;

        try {
            return MethodToTryCatch();
        }
        catch (e) {
            if (CustomErrorMessage !== undefined)
                alert("Error (" + CustomErrorMessage + ") : " + e);
        }
    },
    R: function (MethodToStartOnDocumentReady, CustomErrorMessage) {
        if (MethodToStartOnDocumentReady === undefined)
            return;

        $(document).ready(function () {
            try {
                return MethodToStartOnDocumentReady();
            }
            catch (e) {
                if (CustomErrorMessage !== undefined)
                    alert("Error (" + CustomErrorMessage + ") : " + e);
            }
        });
    },
    L: function (MethodToStartOnWindowLoad, CustomErrorMessage) {
        if (MethodToStartOnWindowLoad === undefined)
            return;

        $(window).load(function () {
            try {
                return MethodToStartOnWindowLoad();
            }
            catch (e) {
                if (CustomErrorMessage !== undefined)
                    alert("Error (" + CustomErrorMessage + ") : " + e);
            }
        });
    }
};

Usage is very simple :

C.R(function () {
    // Run MyCustomFunction on document ready
    MyCustomFunction();
});

C.L(function () {
    // Run My Custom code on window loaded
    // My Custom code .... 
});