![JAR search and dependency download from the Maven repository](/logo.png)
public.javascripts.big-pipe-with-mustache.js Maven / Gradle / Ivy
The newest version!
(function(window, mustache, BigPipe) {
"use strict";
var document = window.document;
var console = window.console;
// In a real app, you'd probably want to store the template in an external file and not inline it like this.
var template =
'' +
'{{ id }}
' +
'took
' +
'{{ delay }} ms
' +
'to respond
' +
'';
// Override the original BigPipe.renderPagelet method with one that uses mustache.js for client-side rendering
BigPipe.renderPagelet = function(id, json) {
var domElement = document.getElementById(id);
if (domElement) {
domElement.innerHTML = Mustache.render(template, json);
} else {
console.log("ERROR: cannot render pagelet because DOM node with id " + id + " does not exist");
}
};
})(window, Mustache, BigPipe);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy