Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts = function(str, tags) {
- var items, localPuts, output, outputs, rootnode, tag, text, _ref;
- localPuts = function(firstElement) {
- var elem1, func, rootnode;
- elem1 = document.createElement(firstElement);
- rootnode = document.body.appendChild(elem1);
- func = function(tagId) {
- return function(textobj) {
- var elem, textnode;
- elem = document.createElement(tagId);
- textnode = textobj.appendChild(elem);
- return textnode;
- };
- };
- return [func, rootnode];
- };
- _ref = localPuts("p"), outputs = _ref[0], rootnode = _ref[1];
- items = (function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = tags.length; _i < _len; _i++) {
- tag = tags[_i];
- _results.push(outputs(tag));
- }
- return _results;
- })();
- alert(items[1]);
- output = _.compose.apply(null, items);
- text = output(rootnode);
- return text.innerHTML = str;
- };
- }).call(this);
Add Comment
Please, Sign In to add comment