Message from JavaScript discussions

November 2017

— That's where it goes, yes

— 

So if your data is null or something, and it doesn't load the data, the template will get loaded just like that

— Placeholders

— Or you could also put some in the destination element

— Since it overwrites without append: true

— But anyways, that's just what I use for my own projects, since I like that data attribute thing and it's W3C valid still

Message permanent page

— It's actually a port of jQuery-template

— 

DialogBox.prototype.render = function () {
if (this.node === null) {
ct.loadTemplate("#dialogTemplate", "#dialogContainer", {
append: true,
data: this.data,
removeAttrs: false,
thisArg: this,
success: this.onRenderSuccess
});
} else {
ct.loadTemplate(this.node, "#dialogContainer", {
data: this.data,
removeAttrs: false,
thisArg: this,
success: this.onRenderSuccess
});
}
};

Message permanent page

— I used it to make a dialog box library, well the start of one

— The else is where the box is already loaded, but the data changed, so it is patching itself

— Because you can load templates from live dom nodes, I just had it load itself as a template and replace itself

Message permanent page

— removeAttrs: false is there so the attributes stay, allowing that patch to work