JSONML transformation utility.
Include the utility:
<script src="JSONML-1.0.0.js"></script>
Create JSONML elements:
var names = ['John', 'Sarah', 'Mike'];
var ul = ['ul', {'class': 'list'}];
var li;
names.forEach(function(name) {
li = ['li', {'class':'list-item'}, name];
ul.push(li);
});
Use makeDOMElement
to transform the JSONML elements to DOM elements:
$container = jQuery('#container-names');
$container.append(
JSONML.makeDOMElement(ul)
);
Licensed under the MIT license. (http://opensource.org/licenses/MIT)