Rasmus Schultz
Member since Aug 3, 2011
- Profile: /members/8723-rasmus-schultz.htm
- Comments: 3
Recent Blog Comments By Rasmus Schultz
-
Using State Change To Bind And Unbind Event Handlers vs. Handler Branching
Posted on Aug 6, 2011 at 7:00 PM
@bemson, "There is always a state, and it must always be managed" - of course, I just happen to find that the DOM, since it's there anyway, might as well be in charge of managing the state of the view, to the extend that this is possible or practical. You cite a lot of theory, but you ha... read more »
-
Using State Change To Bind And Unbind Event Handlers vs. Handler Branching
Posted on Aug 5, 2011 at 3:15 PM
@bemson, But your functions also fire when the element is accessible - which is all the time. You're just switching out the event handlers - you're not performing any checking to see if the function should execute. In fact, as stated, if you were to add a third function, you would need to make sur... read more »
-
Using State Change To Bind And Unbind Event Handlers vs. Handler Branching
Posted on Aug 3, 2011 at 8:54 AM
Another approach to maintaining form state, is using class-names - I posted a fiddle based on your example here: http://jsfiddle.net/Ps5ng/ This relies on the DOM for state, and jQuery live event handlers for the binding. There are two things I like about this approach: 1. You can easily inclu... read more »