Template
is a simple class that provides an easy way to re-use and build HTML with jQuery
. Extend the Template
class, provide a string of HTML/jQuery
, and start writing code like this:
var chatMessage = new ChatMessage()
.setText("Hello!")
.setSender("Darryl")
.appendTo("body");
Result
<div class="chat">
<span class="chat-sender">Darryl: </span>
<span class="chat-msg">Hello!</span>
</div>
Every instance of Template
inherits all jQuery
functions, and you can even chain jQuery
with your own class methods. A few Template
s have been created and are available as add-on packages (must be included after Template
): Feedback
, Table
- which includes RenderTable
and Control Table
, Form
- which includes Wizard
, and an increasing variety of Bootstrap
classes.
Check out the Template wiki for examples and details.
View the docs for a jsDoc
documentation, or check out the Wiki for step-by-step explinations of how to use all of the classes.
Include the minified or non-minified production builds in your web app. For other Template
libraries, like Table, Form, and the Bootstrap Templates, include them after the Template
build files.
Template
depends on the WebUtil library. This small library is already built into the distribution and does not need to be included.
Written by Anthony Agostino.
Licensed under the MIT license.