I love jQuery. It's the best one.

The selectors supports XPATH (not only CSS), and they are easy to extends.

You can create your own events like Mochikit. And the MVC Plugin
support event hierarchy for do complex forms easily (it's inspired in
XForms and you load it only if you need).

Have a lot of plugins, and it's very easy create a new one. A more
complex frameworks like Ext (based on YUI) or Dojo have a more
coherent set of widgets, but it have a coherents sets of widgets too
(http://ui.jquery.com/).

A silly example of plugin creation:

--- start jquery plugin ----
(function($){ //Hack to e compatible with Prototype
    $.fn.AutoChange = function(options){
        var options = $.extend({
            delay: 750  //default option
        }, options);
        return this.each(function(){ //permit chaining jQuery elements
            var $elem = $(this); //Create a jQuery element for each DOM element
            var timeout;
            $elem.keydown( function(event){
                clearTimeout(timeout); //cancel change event when a
key is pressed
                timeout = setTimeout(onChange, options.delay);
            
}).keypress(function(){}).blur(function(){clearTimeout(timeout);onChange();});
            function onChange(){
                $elem.trigger("change");
            }
        });
    }
})(jQuery);
--- end jquery plugin ----

---- start code in a page -----
$(document).ready(function(){
  $("[EMAIL PROTECTED]
[EMAIL PROTECTED]").AutoChange({delay:500}).change(function(){
     //Validate the item of the register form when the user change a
text or stay 500 milis without type anything
    .... //Your validation code
  });
});
---- end code in a page -----

Take a look to a one line of the code:
 * $("[EMAIL PROTECTED] [EMAIL PROTECTED]") selects all inputs of
type text of the register form. The code is more concise than words.
It's an example, usualy its simply ;-)
 * .AutoChange({delay:500}) and initialize the AutoChange plugin in
these inputs whith the delay property set to 500 (defaults 750).
 * .change(function(){...}); and bind an inline generated function to
the onChange event of these inputs (that is triggered by a default or
custom event).

It is not dificult, only a bit strange the firsts times.

Excuse my poor english.

Regards,

Javi

2007/9/20, iain duncan <[EMAIL PROTECTED]>:
>
> On Mon, 2007-17-09 at 06:40 +0000, Richard Clark wrote:
> > I like mochikit but I've been using mootools a fair bit recently due
> > to the better effects gear.
>
> Wow, after a couple of days of doc reading, I have to say mootools is
> the only 'Big' Js library that gives me the same happy feelings about
> the code I'll type that Mochikit does.
>
> Thanks for the suggestion!
> Iain
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to