doAction( "load" )

doAction( "load" );

The load action is fired after the API was fully loaded, but before it is initialized - i.e. before any options are parsed or any Area is processed.


// Disable debugging by changing the Options object.
DiviArea.addAction( 'load', function() {
    DiviAreaConfig.debug = false;

    // Disable the "Debug.log" function by replacing it with an empty function.
    DiviArea.Debug.log = function() {}


This is always the first action that is fired by the JS API. You can use this action to overwrite core functions with your own code, like this basic example:

DiviArea.addAction( 'load', function() {
    var origFunction =; = function( showWhat ) {
    console.log( 'Custom Show Wrapper called!', showWhat );

    // Call the original `` function.
    var res = origFunction( showWhat );

    if ( ! res ) {
        console.log( 'Could not show the area... is that name correct?', showWhat );


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.