Questions tagged [jtemplates]

jTemplates is a template plugin written for the jQuery.

jTemplate is a template engine used in conjunction with the jQuery library.

It's current features include:

  • 100% in JavaScript
  • precompilator
  • Support JSON
  • Work with Ajax
  • Allow to use JavaScript code inside template
  • Allow to build cascading templates
  • Allow to define parameters in templates
  • Live Refresh! - automatic update content from server

Template Example:

    var data = { "header": "Header Text", "text": "Hello World!" };

    //Where result is the template target
    $("#result").setTemplate(
          '<h3>{$T.header}</h3>' +
          '<p>{$T.text}<p>');

    $("#result").processTemplate(data);

Works with:
- Firefox 1.5+
- Internet Explorer 6+
- Opera 9+
- Safari 3+
- Google Chrome
- modern mobile browsers (iPhone, Android, Windows Phone)

42 questions
4
votes
1 answer

jTemplates vs jQuery Templates. Which is one better? Is there a better?

I've seen that Microsoft has created a official jQuery Template plugin for jQuery. But also jTemplates from what I've read is pretty popular. I didn't know if I should not bother with jTemplates and go straight to the jQuery Template or give…
dotnetN00b
  • 5,021
  • 13
  • 62
  • 95
3
votes
1 answer

Choosing the fastest template plugin for data table

I recently changed our asp.net gridviews (which worked with update panels) to HTML tables, using jquery-Ajax and templating using jtemplates. The performance improvement was huge!!! (on the server side I am using a generic httphandler). One…
Yaniv Efraim
  • 6,633
  • 7
  • 53
  • 96
2
votes
2 answers

jTemplates {#for} not working in Internet Explorer 7, bug?

I have struggled a lot with jTemplates but I continue to fail with {#for} in Internet Explorer 7 while it works perfectly in Firefox and Chrome (not tested with other browsers). I created a jsFiddle with a very simple test case, please can you tell…
Thomas
  • 154
  • 6
2
votes
0 answers

Cache jTemplates template URL

Is it possible to cache the template passed into jTemplates? I am loading table data via setInterval every minute and it grabs the template each time, only 1.6kb, but still. From the jTemplates Documentation it seems to accept a caching object but I…
AdamRoof
  • 264
  • 2
  • 11
2
votes
1 answer

How to read the data from javascript in jtemplate

i have got the json data in my js file and now i need to pass the same to jtemplate and display. Here is the code i tried, but no data is getting displayed $.ajax({ url: '/CMananager/getDetails', contentType:…
Naruto
  • 9,476
  • 37
  • 118
  • 201
2
votes
1 answer

jQuery jTemplates Show "empty" message

I'm using jTemplates with jQuery. I'd like to show a message when there are no results, instead of just nothing. I have tried including the message in the template and using a function in the {#foreach} loop to hide it, but that does not work. …
Jeremy
  • 31
  • 5
1
vote
0 answers

Object notation in custom JavaScript code in jTemplates

I'm using jTemplates jQuery plugin and I have a JavaScript function that accepts an object as an argument. I'm calling this function from my template and trying to pass a parameter in the following form of short object…
Boris
  • 43
  • 5
1
vote
1 answer

How does jTemplates perform?

I'm working on a website that I plan to have a lot of JSON/AJAX generated lists (kind of like a social networks news feed). How does jTemplates work with this kind of situation? Is there a better solution? From what I can see, it looks nice, but…
Adam
  • 9,189
  • 15
  • 46
  • 62
1
vote
3 answers

Does having a larger amount of data in the DOM affect performance, Should i lazy load

I make heavy use of the excellent jTemplates plugin for a small web app. Currently I load all of the templates into the DOM on the initial page load. Overtime as the app has grown I have gotten more and more templates - currently about 100kb…
Trev
  • 157
  • 1
  • 8
1
vote
1 answer

Browser making unwanted request in script tag

I've been supplied some code from a 3rd party supplier to integrate on some of my webpages, which uses the jQuery plugin for jTemplates. Code looks similar to this: