Abstract: A method in a client web browser for constructing a nested Document Object Model (DOM) module for a website. The module includes a module template, which includes tags to be replaced with data, and a module Driver, which includes functional code for creating a nested data structure. A client-side templating engine retrieves data from a data source that includes data for populating the tags and data for creating a plurality of data blocks for the nested data structure. The templating engine populates the tags in the module template with the data for the tags, and the module Driver sequentially creates the data blocks using the data for creating the data blocks. Upon completion of each data block, the module Driver appends the completed data block to the module template to create the nested data structure. The completed module includes the template with populated tags and the nested data structure.
Abstract: A method in a client web browser for constructing and executing a website Document Object Model (DOM) module, which includes client-side functional code in both a module Driver and a module template. The module Driver includes functional code controlling operation of the module Driver, and the module template includes both functional code controlling operation of the module template, and Hypertext Markup Language (HTML) markup that includes DOM elements and tags to be replaced with data. The browser executes the functional code in the module Driver to populate the tags in the module template with data obtained from a data source. The browser executes the functional code in the module template to perform logical calculations on the data, and to display portions of the module template to a user depending on results of the logical calculations.
Abstract: A method in a client web browser for preventing collisions and eliminating polling for matching Document Object Model (DOM) elements while operating a website. The browser receives from a server, information for creating a DOM from a plurality of DOM modules. A module includes a template and a Driver. A unique class attribute for the Driver is created from an identifier tag, enabling the Driver to operate independent of other modules. A variable set to reference a DOM element in the template is utilized to sandbox all actions by the Driver into the referenced DOM element in the template, thereby preventing collisions and eliminating polling for matching DOM elements. The Driver retrieves data for the module, replaces tags in the template with corresponding data, attaches event listeners to defined DOM elements in the template, and manipulates DOM elements as needed to enable user interaction with the DOM module.
Abstract: A method in a client web browser for loading separate Document Object Model (DOM) modules utilizing self-referencing of running script elements. Each module is separated into a module template and a module Driver. The module template includes tags to be replaced with data, and the module Driver includes an identifier (ID) tag, a driver variable, a display variable, and functional code controlling the operation of the Driver. The functional code causes the Driver to: ensure the ID tag is set as a unique identifier for the module, thereby creating a unique ID attribute for the Driver; set the driver variable to reference the module Driver; and set the display variable to reference in the module template, a DOM element that can be found relative to the module Driver. The referenced DOM element may be the DOM element in the template immediately prior to the module Driver.