Skip to content

json2html is a simple but powerful free jQuery plug-in used to render json to html. Using custom defined JSON transforms json2html will convert a JSON array of objects, such as an RSS feed, into an unstructured list.

Notifications You must be signed in to change notification settings

bazineta/json2html

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON2HTML

What is json2html?

json2html is a simple but powerful jQuery plug-in used to transform JSON to HTML.

Why json2html?

Instead of writing HTML templates JSON2HTML relies on JSON transforms to convert a source JSON objects to html. The benefit of using a JSON transform is that they are already readable by the browser and DO NOT require any compilation before use. In addition, JSON2HTML allows the following

  • Short hand notation for mapping data objects to markup
  • Event binding to DOM objects
  • Use of inline functions to allow for complex logic during transformation

Example of a Transform?

var transform = 
 {tag:'li',id:'${id}',children:[
	{tag:'span',html:'${name} ${year}'}
  ]};		

Will render into the following html

<li id=1123>
	<span>Jack and Jill (2001)</span>
</li>	

Where is the project now?

json2html has been fully released (v 3.1) and has being used in production on a number of projects. Performance wise it's comparable to jQuery templates (around 20% slower). Any additions/improvements are very much welcome!

How do I start?

Check out our website www.json2html.com for more information including detailed usage notes, downloadable examples and more!

About

json2html is a simple but powerful free jQuery plug-in used to render json to html. Using custom defined JSON transforms json2html will convert a JSON array of objects, such as an RSS feed, into an unstructured list.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%