PureJSTemplate

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-12 19:43:05

软件介绍

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 = "<div>" + data.text + "</div>";
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.

本文地址:https://codercto.com/soft/d/23243.html

白话区块链

白话区块链

蒋勇 / 文延、嘉文 / 机械工业出版社 / 2017-10-1 / 59.00

由浅入深:从比特币开始,到区块链技术的骨骼(密码算法)和灵魂(共识算法),再到目前知名的区块链框架介绍,到最后从零构建一个微型区块链系统(微链),循序渐进。 多图多表:各种示例以及图表,通过流程图与示意图介绍比特币的源码编译、以太坊智能合约的开发部署、超级账本Fabric的配置使用、模拟比特币的微型区块链系统的设计实现等,形象而直观。 白话通俗:通过“村民账本记账”、“百花村选举记账”......一起来看看 《白话区块链》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试