javascript - Hiding HTML template from client side -
I want to keep my client-side code as clean and minimal as possible My project uses the knockout JS and this template engine: I have created the template in the lower section of my source code according to the team value given in the "Pre" section (I really do not want to appear). Is there a way to hide the template and when it loads the DOM?
To load your template from the server, give them your own small Then when you want to use the template, you can call Note: I have forced jquery to synchronize to use .html < / Code> files, and then on the client, you can use them to bring them into one variable:
// Variables We are putting the template into var myTemplate; $ .ajax ({async: wrong, type: "gET", url: "/templates/myTemplate.html", success: function (data) {myTemplate = data;}});
templ () with the template:
Var results = Tmpl (myTemplate, data);
async: false because you make sure You want to say that the template is present there.
Comments
Post a Comment