Skip to content

A small totally self contained Java Script class that generates HTML from JSON notation

License

Notifications You must be signed in to change notification settings

it-s/js-UIBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-UI-Builder

A small totally self contained Java Script class that generates HTML from JSON notation

All you need is a JSON array containing the descriptions of the lements you wish to be rendered on page.

###Dictionary

  • tg: tag of the element (the default is 'div')
  {tg: 'span'}
  • id: id of the element
  example: {id: 'foo'}
  • cl: array of element classes
  {cl: ['foo', 'bar']}
  • ar: an object containing element attributes
  {ar: {type: 'checkbox', checked: true}}
  • dt: data attribute
  {dt: 'foo'}
  • tx: text inside the container
  {tx: 'Some text'}
  • ac: object containing element actions, such as onClick, etc
  {ac: {onClick: function(e){return false;}}}
  • cn: array of element children
  {cn: [{tg:'input'}]}

About

A small totally self contained Java Script class that generates HTML from JSON notation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published