We've been working on some heavy-duty javascript projects for some of our recent clients, and docs are fairly weak on writing your own custom jQuery UI widgets, so I wrote this up.
Unfortunately your site is down as of this writing, so I didn't read the article yet.
Regardless, for all who are interested in organizing their jQuery click-driven spaghetti-code, I'd recommend checking out JavascriptMVC (at http://v3.javascriptmvc.com/index.html). It's not a stable release yet but it's getting there quickly :)
It provides you with
- a minimalistic MVC framework
- a script loader/dependency/build system
- very intuitive event handling
- testing
- documentation
I'm not affiliated with the project, but I think its worth a try for anyone interested in best-practices for large javascript applications.
The great thing about widgets is that they act as OO Classes on top of a DOM object. So you can say 'make this DOM object act like an XYZ'. Sometimes the XYZ is a very visible thing (checkbox, draggable, etc), but other times, we have pure code widgets that do internal routing, or traditional "controller" type activities.
For instance, each <li> may be a widget that does... whatever, but then the <ul> may be a widget that listens for events, and adds/removes <li>s from underneath it as appropriate.
4 comments
[ 2.8 ms ] story [ 16.3 ms ] threadRegardless, for all who are interested in organizing their jQuery click-driven spaghetti-code, I'd recommend checking out JavascriptMVC (at http://v3.javascriptmvc.com/index.html). It's not a stable release yet but it's getting there quickly :)
It provides you with - a minimalistic MVC framework - a script loader/dependency/build system - very intuitive event handling - testing - documentation
I'm not affiliated with the project, but I think its worth a try for anyone interested in best-practices for large javascript applications.
The great thing about widgets is that they act as OO Classes on top of a DOM object. So you can say 'make this DOM object act like an XYZ'. Sometimes the XYZ is a very visible thing (checkbox, draggable, etc), but other times, we have pure code widgets that do internal routing, or traditional "controller" type activities.
For instance, each <li> may be a widget that does... whatever, but then the <ul> may be a widget that listens for events, and adds/removes <li>s from underneath it as appropriate.