On Mon, Dec 15, 2008 at 10:13 AM, Jan Limpens <jan.limp...@gmail.com> wrote: > > Hi guys, > > I wonder if anybody knows a good page/tutorial/etc... that explains > good practices in structuring a project that uses jquery. > Currently I have a mess of files that all populate the global name > space with things currently in need. > If my server side programming looked like that, I'd through me out of > the window :) > > I need to fix this up, probably putting things in classes (well, these > funny top level functions that work like classes, in a way) etc.. > > But how does this work with things like $(document).load(...)? And > many questions (most of which have not come into my mind) more. >
If you want a more class-like setup, have a look at the WymEditor [1] code, which extends the JQuery objects associated with textareas, and the Tidy plugin, which extends WymEditor's functionality. As far as files go (if that's what you're also asking about), I generally keep jQuery and its plugins in js/lib, with 'jquery-' in the filename. The rest of my code i put in js/, though sometimes in subdirs relating to the application. [1] www.wymeditor.org