Bipolar: Objects vs. Primatives
28 Jul 2009
The other day I was making an isFalsy() function in JavaScript. It was then that I fell into the nexus of the universe. It turns out there is a case where "something == false" and "!something == false".
Check it out. All the following statements are true:
IE Lost My Node Contents
15 Jul 2009
I ran into the most bizarre JavaScript bug that plauges all versions of IE.
However, in IE, the node retains its attributes but has no children. That's right, #getElementsByTagName() returns an empty HTMLNodeList. #children? Empty HTMLNodeList. The weirdest thing is that #firstChild still exists, but it is an object with no properties whatsoever.
IE Lost My Node Contents
15 Jul 2009
I ran into the most bizarre JavaScript bug that plagues all versions of IE.
I get a reference to a node, set the parent's innerHTML then try to manipulate the node. The node should have all it's properties and child objects and does in standards-compliant browsers.
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.
Goodies
10 Jun 2008
I ran into two great concepts today. First, there is a way to prevent circular references that choke IE's garbage collector. (View Article) I'll need to check into the concept more to see where I can use it. Hopefully it can be used in an event listener system. Thanks Kip!
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.
- « first
- ‹ previous
- 1
- 2
- 3
