A Javascript library/DSL that facilitates creating DOM elements on-the-fly.
JavaScript
Latest commit 20aed40 Jul 31, 2009 airportyh format README
Permalink
Failed to load latest commit information.
examples added with method of importing Jul 31, 2009
README format README Jul 31, 2009
describe.js
ecma5array.js first commit Jul 30, 2009
jquery.js
spec.js
test.html updated spec Jul 30, 2009
thinair.js changed importCode to imports Jul 30, 2009

README

ThinAir is a Javascript library/DSL that facilitates creating DOM elements
on-the-fly, it depends on jQuery.

Example:
// you can create an text input like so:
var textInput = thinair.input({type: 'text', name: 'name', value: 'Bobby'})
// now you can insert this element into the page using jQuery
$(document.body).append(textInput)

For a more elaborate example see the examples/ directory, or spec.js.

How to up the "pretty" by not writting "thinair." every time you create an element:
Method 1 - extend the window object with all the tag names:
  $.extend(window, thinair) // this works but will pollute your global namespace
Method 2 - use eval to create the variables in local scope:
  function(){
    eval(thinair.imports) // this will create the tags methods as local variables 
    p('it works!')        // in your current scope
  }
Method 3 - use with:
  with(thinair){
    p('it works!')
  }
Dependencies:
    - jQuery: http://jquery.com/
    - ecma5array: http://github.com/airportyh/ecma5array/tree/master

Author: Toby Ho(tobyho.com)