Giter Club home page Giter Club logo

jrender's Introduction

Jrender

a fast data render based on jQuery which could be convenient for show data in html from json

一个基于jQuery的json数据快速展示系统

Advantage/优势

1.无需写无关的script块模板代码

2.支持自定义回调用来处理特殊的数据绑定

3.轻量无依赖,如果你不考虑angular,value 这种大家伙

4.特别适应于小页面开发,比如移动端

劣势

暂不支持table,下个版本即将支持

samples

html code

<div class="info">
	<span render-html="weather"></span>
	<ul render-loop="seven_days">
	        <li render-html="seven_days.weather"></li>
	</ul>
</div>

js code

var data = {
    weather:'sunshine',
    seven_days:[
        {
            weather:'windy'
        },
        {
            weather:'rainy'
        },
        {
            weather:'cloud'
        }
    ]
};
$(".info").renderValues(data);

#desc 1.所有的数据展示都是在某一个标签内

all kind of data must be show at one html element

sample

<span render-html="username"></span>

if the type is loop, the child element should be surrounded with a div

循环类型的子循环,子元素的第一个元素,所以尽量套一个div进去

right

<div render-loop="seven_days">
    <div>
    	<span render-html="seven_days.temperature"></span>
    	<span render-html="seven_days.weather"></span>
    </div>
</div>

wrong

<div render-loop="seven_days">
    <span render-html="seven_days.temperature"></span>
    <span render-html="seven_days.weather"></span>
</div>
  1. type list which can be render
render-html, 
render-src, 
render-value, 
render-href, 
render-loop, 
render-attr(self defined property:render-attr="userid=uid")
render-key(this should provide a render-fun property ,please read exmples)

note

Jrender don't support table now

jrender's People

Contributors

suxianbaozi avatar

Watchers

James Cloos avatar 95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.