Graft: Making Javascript DOM a Piece of Cake

schadenfreude has been frustrated by DOM, and and decided to make Javascript DOM a Piece of Cake with the graft() Function, This comes from Sean Burke and his Higher Order JavaScript book. Graft enables code such as this:
JAVASCRIPT:
  1. graft(
  2. document.getElementById("mycontentdiv"),
  3. ["table",
  4. {border:1,cellpadding:0,cellspacing:0},
  5. ['tr',
  6. ['td',
  7. {valign:'bottom'},
  8. "Graft()"
  9. ],
  10. ['td',
  11. "makes"
  12. ],
  13. ['td',
  14. "this"
  15. ],
  16. ['td',
  17. {style:'background-color:#ff0;'},
  18. "easier",
  19. ["em",
  20. {style:'font-size:32px;'},
  21. " to do.."
  22. ]
  23. ]
  24. ]
  25. ]
  26. );

Graft: Making Javascript DOM a Piece of Cake

schadenfreude has been frustrated by DOM, and and decided to make Javascript DOM a Piece of Cake with the graft() Function,

This comes from Sean Burke and his Higher Order JavaScript book.

Graft enables code such as this:

JAVASCRIPT:
  1.  
  2. graft(
  3.     document.getElementById("mycontentdiv"),
  4.     ["table",
  5.         {border:1,cellpadding:0,cellspacing:0},
  6.         ['tr',
  7.             ['td',
  8.                 {valign:'bottom'},
  9.                 "Graft()"
  10.             ],
  11.             ['td',
  12.                 "makes"
  13.             ],
  14.             ['td',
  15.                 "this"
  16.             ],
  17.             ['td',
  18.                 {style:'background-color:#ff0;'},
  19.                 "easier",
  20.                 ["em",
  21.                     {style:'font-size:32px;'},
  22.                     " to do.."
  23.                 ]
  24.             ]
  25.         ]
  26.     ]
  27. );
  28.  

October 18th, 2006

Tagged View

Tags Similar

Posts Fresh +

Categories View

Archives View