Patent ID: 9646103
Date: 2017-05-09
CPC Classifications: G06F

Claim:
1. A computer-implemented method of constructing a nested Document Object Model (DOM) module for a website utilizing a client-side templating engine, wherein a processor within a computer executes code stored in a non-transitory memory to perform the steps of: receiving by the client-side templating engine, a single call to create the nested DOM module, wherein the client-side templating engine creates the nested DOM module to include a module template and a module Driver, wherein the module template includes DOM elements and 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 operation of the module Driver; retrieving by the client-side templating engine, data from a data source, wherein the data from the data source includes data for populating the tags in the module template and data for creating a plurality of data blocks to be included in a nested data structure for the DOM module; executing the functional code controlling operation of the module Driver to ensure the ID tag is set as a unique identifier for the DOM module, thereby creating a unique ID attribute for the module Driver, which enables the module Driver to operate independent of other drivers that control other DOM modules in the DOM; executing the functional code controlling operation of the module Driver to set the driver variable to reference the module Driver, thereby loading the functional code into memory and removing the module Driver from the DOM; executing the functional code controlling operation of the module Driver to set the display variable to reference in the module template, a DOM element that can be found relative to the module Driver, thereby sandboxing all actions by the module Driver into the referenced DOM element in the template, preventing collisions with the other DOM modules running asynchronously elsewhere on the webpage, and eliminating polling for matching DOM elements; executing the functional code controlling operation of the module Driver to populate the tags in the module template with the data for the tags; executing the functional code controlling operation of the module Driver to sequentially create the plurality of data blocks using the data for creating the data blocks; upon completion of each data block, executing the functional code controlling operation of the module Driver to append the completed data block to the module template to create the nested data structure; and in response to the single call to create the nested DOM module, the client-side templating engine returning the nested DOM module, including the template with populated tags and the nested data structure.