Global

Members

get

GET OPTION.

GET OPTION. Utility function to get a property of embedded options object.

Source:

isset

IS SET OPTION.

IS SET OPTION. Public utility function to check if there is a variable, if it has been defined. You must pass the ' typeof ' of the Variable, not the variable itself. For example: alert (RSLIB.requireIsset (typeof unknown_variable));

Source:

nameLIB

NAME LIB.

NAME LIB. Name of library to load

Source:

onComplete

ON-COMPLETE EVENT.

ON-COMPLETE EVENT.

Event employee for pass an external callback function to be executed upon completion of the loaded library.
This can be useful if, for example, you want to immediately use a resource (variable, object, method, ...) defined in the library.

This should be done within the ' callback ' function as incorporating the various scripts in HTML-Head of a synchronous load page ' modifies the flow execution javascript ' occurs due to the DOM modification, it can (depending on the browser) run the last library scripts.

Source:

options

EMBEDDED OPTIONS.

EMBEDDED OPTIONS.

An embedded options object within the label ' script ' is expected to pass to this loader with the terms:

  • nameLIB: name of the library to load
  • pathToLIB: path (relative or absolute) to the library directory with respect to HTML caller.
  • scripts: An array with the path relative to each script file you want to load. The last element of the array will not be loaded, which is only indicates the main on which to launch the ' onComplete (..) ' method.
Source:

pathToLIB

PATH TO LIB.

PATH TO LIB. Path to the library directory with respect to HTML caller.

Source:

rsLIB

'ASYNC REQUIRE LIBRARY' OBJECT.

'ASYNC REQUIRE LIBRARY' OBJECT.

ASYNC REQUIRE LIBRARY :: INSERT THE LINKED-SCRIPTS PARAMETERS IN THE HEAD SYNCHRONOUSLY, BUT WITHOUT AJAX.

It is the loader object (global ' rsLIB ' variable ) with an anonymous loader function and as members:

  • options: the complete object detected as embedded options.
  • nameLIB: name of library to load.
  • pathToLIB: the path to the library, based on the situation of HTML caller.
  • scripts: the array of scripts to load the library.
  • get: get properties of embedded object.
  • isset: utility method to check whether a variable is undefined.
  • onComplete (..): The method that can be passed a ' callback ' function as the only parameter.

Import dynamically (albeit unorthodox) all the library 'assets' , it inserting (if not previously existed) after the label linked with this file (rsLIB.js) in the 'head'. It work synchronously, that is, they must wait until they are loaded and interpreted to use them immediately.

If so required (immediately) because some variable or function defined in scripts is used, should work within the event onComplete(..) through a function callback, for example:

  
  rsLIB.onComplete( function(){
      //code to execute when the scripts are loaded.
  } );
  
Source:

scripts

SCRIPTS TO LOAD.

SCRIPTS TO LOAD. Scripts to dynamic load for the loader function. They should contain the relative path.

WARNING: THE LAST ELEMENT NOT BE CHARGED, WHICH IS ONLY INDICATES THE MAIN ON WHICH TO LAUNCH THE ' onComplete(..) ' EVENT.

Source: