Javascript createFromTemplate - jcobban/Genealogy GitHub Wiki

function createFromTemplate(template, parms)

Up: Common Dialog Support

Source: /jscripts/util.js

This function creates a node and its subnodes as a clone of an HTML template, performing substitution of symbol values from an associative array object into the string elements of the node and its subnodes.

parameter contents
template an HTML node with children that represents the logical structure to be reproduced or the id attribute of such a node as a String
parms an associative array of symbol values to be substituted into the text values and selected attributes of the HTML structure. Wherever a symbol reference starting with a dollar sign ($) occurs in a string value the symbol reference is replaced by the corresponding value from parms. If this is omitted or is not an Object then it is ignored.

Returns an HTML node with children ready for display.

Next: function displayHelp(element)