Someone posted a very useful template plugin a few days ago...
*digs it out*
here you are:
http://groups.google.com/group/jquery-en/browse_frm/thread/bde06a2e99f31efe/8e63b6928948c4c2?hl=en#8e63b6928948c4c2
> Hi,
> I made a simple port of Ext.Template [1] / Ext.MasterTemplate [2] to
> be used with jQuery, removing Ext dependencies and so. The result is
> tiny - 2,4KB packed, and given that it can make other codes smaller, I
> think it is worth. Here's the code (feedback appreciated, I'm not a
> javascript master! ;):

> http://dev.tipos.org/browser/javascript/jquery/template/jquery.templa...

> I still have three global functions while I'm looking for alternatives
> in the jQuery world. I'm looking for something that helps extending
> classes / overriding class members in jQuery or any jQuery
> plugin/utility. Something like the extend() function in YUI or Ext. Is
> there any?

> thanks,
> rodrigo

> [1]http://extjs.com/deploy/ext/docs/output/Ext.Template.html
> [2]http://extjs.com/deploy/ext/docs/output/Ext.MasterTemplate.html

> -------------------------------

> Usage (based on Ext.MasterTemplate docs):

>     var t = new $.MasterTemplate(
>         '<select name="{name}">',
>             '<tpl name="options"><option 
> value="{value}">{text}</option></tpl>',
>         '</select>'
>     );
>     t.add('options', {value: 'foo', text: 'bar'});

>     // or you can add multiple child elements in one shot
>     t.fill('options', [
>         {value: 'foo', text: 'bar'},
>         {value: 'foo2', text: 'bar2'},
>         {value: 'foo3', text: 'bar3'}
>     ]);

>     // then append applying the master template values
>     $(document.body).append(t.apply({name: 'my-select'}));

On Jun 7, 12:26 pm, "Mandy Singh" <[EMAIL PROTECTED]> wrote:
> Anyone?
>
> On 6/7/07, Mandy Singh <[EMAIL PROTECTED]> wrote:
>
>
>
> > hi,
>
> > does jquery offer some kind of javascript templates plugin?
>
> > wat do (if they do) ppl use?
>
> > since i have a box structure on my page where more or less every box is
> > similar in markup, i would want to create a template of that with javascript
> > vars for unknown content that i later fetch through json response.
>
> > makese sense?
>
> > pls let me know.
>
> > thx,
> > mandy.

Reply via email to