jquery micro template
A JS template methodology without seperate template container like TrimPath etc.
<div id="test1" class="users">
<!for (var i=0;i<users.length;++i)
{!>
<div onMouseOver="/*=users[i].color?'this.style.color=\''+users[i].color+'\';':''*/" id="user_<!=i!>" class='user'>Name:<a href="<!=users[i].name!>"><!=users[i].name!></a></div>
<!}
!>
<pre>'somthing'
else ...</pre>
</div>
<script>
var data1={users:[{name:'name1.1'},
{name:'name1.2', color:'yellow'}
]
};
$('#test1').drink(data1);
</script>
评论