I am using jquery templates to display JSON input. I would like to load the template into a cache file. How to do it?
UPDATEhttp://encosia.com/2010/12/02/jquery-templates-composite-rendering-and-remote-loading/ isvery close to the solution I ended up with, instead I used an iframe;
These 2 pages seem to give the answer quite nicely:
It seems that there are several methods for implementing each of them with its advantages / disadvantages.
1) script. . ,
2) javascript. , .
3) JSON. , ?
4) iframe iframe - , /, ,
, , iframe, , .
ajax- , aspx
$.ajax({ url: "myprog.aspx", data: { whichTemplate: "template I'm Looking for" }, success: function(result) { // result is the text string containing either a single template or a delimated list of templates $.template('templatename', result); } , dataType: "text" });
, :
<script id="entry_show_template" defer type="text/html"> <div class="entry"> Age: <span class="age"></span> <a class="name" href="#"></a> </div> </script>
, src, :
$('#entry_show_template')
See my answer for jQuery templates - where to put them?
In addition to the article from Dave Ward that you talked about in your question, he refers to some additional tricks from Introduction to jQuery Templates, Stephen Walter . In particular, it describes how to extract a template once and cache its compiled version.
Source: https://habr.com/ru/post/1774786/More articles:Indy10 file transfer causes 100% CPU usage - delphiWPF: Is it possible to adapt the path size to the size of the layout, but still stretching it? - layoutJBoss JNP as a standalone server and using resource configurations from tomcat context.xml - javaproblems with ajax form inside jQuery UI popup in IE8 - jqueryAndroid / samsung galaxy S emulator - android_OBJC_CLASS _ $ _ - character not found error - objective-cКакие параметры проверки подлинности у вас есть в django? - pythonIs there a way to use watir to open a link in a new tab or window in firefox - ruby | fooobar.comIs it true that using pointers is significantly faster than using array syntax in C? - performanceWhat are the most beautiful programming languages? (In your opinion) - programming-languages | fooobar.comAll Articles