Javascript/Functional UI
Introduction
I've recently discovered a way of building user interfaces with Javascript that doesn't follow MVC rules. It seems simpler and more flexible. It relies heavily on closures and anonymous functions. However, it is clear and precise.
General Concepts
- Restricted number of global variables. You may be able to get rid of them altogether.
- Heavy use of closures and anonymous functions.
Dialog Widget
Let's suppose you want to create a dialog. This dialog pops up when the user clicks a button. Here's one way to do it.
var dialog_el;