jquery-templates

The new jQuery Templates from Microsoft and SEO

Scott Guthrie just blogged about the new jQuery Templates that his team has been working on, and I must say... this looks really sweet. I have a multi-part question however, where the answer will influence my decision to use them. I'm currently working on a project whereby the home page displays a list of upcoming events in your region....

Is it possible to invoke the jQuery.data() method within a jQuery template?

I'm using the jQuery template plug-in (official jquery-tmpl plugin) to build up a an HTML list. The template basically defines <li> elements and looks something like this: <script id="item-display-template"> type="text/html"> <li> <div class="item-display-container"> <p>${SomeData1} .... ${SomeData2} etc....</p> <a...

jQuery template() for putting a URL into src= attribute of image

i have a jquery template: <div id="test_template"> <img src="${url}" width="31" height="32" alt="" /> ${url} </div> I compile it with this: test_template = $('#test_template').template(); I render it with this: $.tmpl(test_template, {url:'http://sstatic.net/stackoverflow/img/sprites.png'}).appendTo('#render_test'); the e...

How do I render a jQuery.tmpl Template to a String?

The documentation for jquery.tmpl uses .appendTo to insert the template into the DOM during the rendering process: $.tmpl( myTemplate, myData ).appendTo( "#target" ); I am attempting to convert an existing app from another templating engine, and my code needs to render a template into a string first before it is added to the DOM. Is t...

How to bind object as a json string to another html element on JQUERY Template plugin

Actually i tried to find it but i was lost in plug-in lines while debugging. I want to show how it is working because there are different template plug-ins. $("#teplateScript").tmpl(arrOfWhatWeWantToBind).appendTo("#divElementwhichWillContainTheOutput"); I want to serialize every element of array(to json of course) with JSON.stringify...

jQuery Template - Reverse Templating

Hello All, So i'm working on a document system with a templating feature built in. On one page you will create your template with 'tags' using the jQuery templating markup: ${RestaurantName} ${ContactName} Then on the documents page you would choose the template to use and then it would convert your tags into HTML markup. The docu...

Using Knockout.js with newest jQuery Files and ASP.NET MVC

I am attempting to use Knockout.js with ASP.NET MVC 3.0 (Title gave it away, didn't it?!) http://knockout.js.com I am running into some problems (more related to the new jQuery Tmpl Engine than ASP.NET MVC 3.0). I am using Steve Sanderson's Example Program in my test, and have mostly replicated his results with the new Razor View Engi...

Callback functions for jquery-templ?

I'm using the plugin jquery-tmpl. Is there a way to specify a callback after a template is run? I want to do something like <script id='itemTemplate' type='text/html'> <li class="item" id=${timestampMs}> <span class="content">${content}</span> </li> ${processItem($('#' + timestampMs))} </script> Where processItem does somet...

Making jquery tmpl without a lot of extra script tags.

I've been reading about the jQuery template plugin http://api.jquery.com/tmpl/ as a means of binding data to markup. All the examples seem to show that you define the template in a script new script tag. I'd actually prefer not to clutter my html <head> with all those script tags. Is there a better way to organize this? Maybe with a tem...