Code Monkey home page Code Monkey logo

jquery-tmpl's Introduction

jQuery Templates plugin 1.0.1

This is the fork of jQuery Templates that we use internally here at Kanban Solutions. We have fixed all known and encountered bugs as well as changing the syntax from the standard

Docs

.tmpl() jQuery.tmpl() .template() jQuery.template()

{%= fieldNameOrExpression %}

Used for insertion of data values in the rendered template. Evaluates the specified field (property) on the current data item, or the specified JavaScript function or expression.

identical to the ${} tag of the origional jQuery Templates http://api.jquery.com/template-tag-equal/

{%html fieldNameOrExpression %}

Used for insertion of HTML markup strings in the rendered template. Evaluates the specified field on the current data item, or the specified JavaScript function or expression.

identical to the {{html}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-html/

{%if fieldNameOrExpression %}

Used for conditional insertion of content. Renders the content between the opening and closing template tags only if the specified data item field, JavaScript function or expression does not evaluate to false (or to zero, null, type "undefined", or the empty string ).

identical to the {{if}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-if/

{%elif fieldNameOrExpression %}

Used in association with the {{if}}...{{/if}} tag to provide alternative content based on the values of one or more expressions. The {%elif%} tag can be used with a parameter, as in: {%if a%}...{%elif b%}...{%/if%}.

Added because the old system actualy overloaded the else tag to handle elif as well and I didnt like that

{%else%}

Used in association with the {{if}}...{{/if}} tag to provide alternative content based on the values of one or more expressions. The {%else%} tag can be used without a parameter, as in: {%if a%}...{%elif b%}...{%else%}...{%/if%}

almost identical to the {{else}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-else/ but I removed the ability to do {{else _test_}}

{%each( index, value ) collection %}

Used to iterate over a data array, and render the content between the opening and closing template tags once for each data item.

identical to the {{each}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-each/

{%tmpl( [data], [options] ) template %}

Used to iterate over a data array, and render the content between the opening and closing template tags once for each data item.

identical to the {{tmpl}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-tmpl/

{%wrap( [data], [options] ) template %}

Used for composition of templates which incorporate wrapped HTML content. Rendered template items can combine wrapped HTML content with template markup.

identical to the {{wrap}} tag of the origional jQuery Templates http://api.jquery.com/template-tag-wrap/

jquery-tmpl's People

Contributors

borismoore avatar jeresig avatar rdworth avatar jzaefferer avatar djgilcrease avatar hoganlong avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.