Extending Host Objects: Evil; Extending Native Objects: Not Evil But Risky
8 Aug 2011
Kangax has a good article on extending JavaScript native objects and host objects. He begins by clarifying that extending host objects (e.g. Element) is truly evil. Host objects do not have strong specs and have no rules and extending them risks collisions. Kangax has an older post talking about extending objects. There he says that Prototype JS's biggest mistake was extending Element.
Element Wrappers in JavaScript
8 Apr 2010
Element wrappers are coming. We are going to see more frameworks using wrappers for JavaScript DOM Elements.
Compiled JavaScript Templating
25 Jun 2008
Compiled JavaScript Templating
25 Jun 2008
Using a find-and-replace template system is often very useful. In Prototype JS, there is a built in class called Template. But for larger html blocks that need basic template logic and formatting functions, compiling the template is fast and robust.
Easing Equations
13 Jun 2008
Robert Penner created a suite of mathematically genius actionscript functions to simulate real-life movements in Flash. The results are compelling.
We see swinging, bouncing, and elastic movements in real life, and even a lot on Flash and even TV due to the work of Rober Penner.
MouseEnter and MouseLeave
5 Jun 2008
Mouseover and mouseout events are not intuitive. I've made a mockup and demo of a very short snippet that addresses the problem.
On a mouseover, the relatedTarget property references the node from which the pointer came. On a mouseout, the relatedTarget property references the node to which the pointer went.On any event, the scope is the node to which the event is attached.When the relatedTarget is a not child of the currentTarget, a mouseover event is equivalent to a mouseenter event and a mouseout event is equivalent to a mouseleave event.
