I use JS/jQuery to load both HTML and "new JS functions" - AJAX call to get the TEXT (sometimes in a file on the server and sometimes from a table in a database).
If the "text" is a function I use EVAL() to load it into the DOM.
Code:
function compileFormula(intGO) {
eval("g_objGrid[intGO].formula = function(currentRow,currentCell,item) {"
+ g_objGrid[intGO].formulaSource + "\n}");
}
If the "text" is HTML I use jQuery to load it into the DOM.
Code:
strEP = g_editpanels[strFromTo] || "";
if (strEP.length == 0) {
strEP = "<br /><span>Edit Panel not found, please try to log in again.</span>";
}
$(strEP).css("display", "none").appendTo(strEditPanel).addClass("acs-edit-bottom")
.removeAttr("id").attr("id", strNewId);
wesEP = $("#" + strNewId);