Domplate

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-13 21:41:55

软件介绍


Overview

The Domplate jquery plugin provides an advanced template system taken and modified from Firebug.

Features:

  • Templates are assembled via function calls instead of strings
  • User-defined callbacks to iterate and format data
  • Object oriented design allows for advanced hierarchies

NOTE: This plugin although functional has not had much actual use outside of the Firebug Firefox extension. It works well with Firefox but may have some problems with other browsers.

You can find more information here: http://code.google.com/p/domplate/
and here: http://www.christophdorn.com/Blog/category/domplate/

If you are interested in helping out to make this plugin cross-browser compatible, please express your interest on the discussion group.

Sample Code

<html>
<head>
  <script type="text/javascript" src="lib/jquery/jquery.js"></script>
  <script type="text/javascript" src="lib/jquery/jquery-domplate.js"></script>
<script>
$(document).ready(function(){
 
  with($.domplate) {
 
    var rep = $.domplate.create(
    {
      tpl: DIV({style:'border: 1px solid red; padding: 10px;'},
            FOR("item", "$items|arrayIterator",
              DIV({style:'border: 1px solid blue; margin-top: 5px; padding: 10px;'},'$item.msg')
            )),
   
      arrayIterator: function(array)
      {
        var items = [];
        for (var i = 0; i < array.length; ++i) {
          var value = array[i];
          items.push(value);
        }
        return items;
      }
    });
   
    var tpl = DIV({style:'border: 1px solid red; padding: 10px;'},'Hello World');
   
  }
   
  $('#body1').render(tpl);
 
  var items = [
               {msg:'Line1'},
               {msg:'Line2'}
              ];
 
  $('#body2').render(rep.tpl, {items:items}, rep);

});
</script>
</head>
<body>
<div id="body1"></div>
<div id="body2"></div>
</body>
</html>

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

顾客要买什么

顾客要买什么

[美]迈克尔·西尔 / 方海萍 / 中国人民大学出版社 / 2006-10 / 38.00元

《顾客要买什么》告诉我们全球的中产阶级如何正在改造着消费品市场:对低价的产品和服务进行趋低消费,对于高端的产品和服务要趋优消费,而对于日趋乏味、价值降低的中档商品则避而远之。这些消费者大多是女性,教育程度高,可支配收入多,买东西的时候也更会精打细算。她们选购、使用商品和服务的时候都是有目的的,有一种大权在握的感觉。消费对她们来说并不是非做不可的麻烦事,也不是什么无法避免的琐事,而是如何明智地花钱的......一起来看看 《顾客要买什么》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

MD5 加密
MD5 加密

MD5 加密工具

SHA 加密
SHA 加密

SHA 加密工具