PureJSTemplate

程序名称:PureJSTemplate

授权协议: 未知

操作系统: 未知

开发语言:

PureJSTemplate 介绍

Works in IE, Firefox and Webkit browsers.
Most templating languages suck

Ok, if your like me then you hate all templating langauges- they suck, they
really suck. I hate them because I hate the rules they enforce upon me, they
are slow, and they slow me down. Because of this, usually I end up making code
that looks like this:

UGLY:

`function display(data) {
var output = “

” + data.text + “
“;
element.innerHTML=output;

}`

How horrible is that? That’s probably worse than using a bad templating
langauge.

Well, after disappointments with other jQuery templating plugins, I decided to
make my own:

The Solution: PureJSTemplate

With PureJSTemplate you use old fashioned javascript in your template. You
simply surround the javascript in special tags. Here’s an example of what you
can do:

<#for(var i=0; i<10; i++) { #> <#=i#> <#}#> That will output the numbers 0 through 9. Easy, isn't it?

Using it:

You simply surround your template code with a textarea tag:

and call it from javascript like so:

$(“#output”).pureJSTemplate(
{
id:”tpl”,
data:{}
});

That’s it.

Get The Code

Visit a demo/benchmark page
here. Get
the js here.

PureJSTemplate 官网

http://plugins.jquery.com/project/puresjstemplate

相关编程语言

多功能下拉选择插件 SelectPage 简洁而强大的下拉分...
AutoComplete 是一个 jQuery Mobile 的插件,用于实...
Combogrid 是一个jQuery插件用于为输入框添加高级自...
Autobox2这个jQuery插件,可以用于创建类似于Facebo...
Link Scraper TextBox 是一个文本框的扩展插件,当你...
Awesomplete 超小超好用的超漂亮的 autocomplete 框...