Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Prototype + lowpro vs. JQuery
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Matt Aimonetti  
View profile   Translate to Translated (View Original)
 More options 30 Jan 2008, 23:55
From: "Matt Aimonetti" <mattaimone...@gmail.com>
Date: Wed, 30 Jan 2008 15:55:01 -0800
Local: Wed 30 Jan 2008 23:55
Subject: Re: Prototype + lowpro vs. JQuery

Some people argued that one could do the same with something like:

var initEvents = function(behaviors){
    /* Add behaviors to the document when it's ready */

    $(document).ready(function(){
        var ruleAndEvent, rule, event, key, fn;
        for(key in behaviors){
            fn = behaviors[key];
            ruleAndEvent = key.split(":");
            rule = ruleAndEvent[0];

            event = ruleAndEvent[1];
            $(rule)[event](fn);
        }
    });

}

You can use it like this:

initEvents({
  'a.alert_hello_world:click': function(event){

      alert("Hello World!"); event.preventDefault();
   },

  'p.hide_myself:click': function() {
      // this refers to the paragraph being clicked
      $(this).hide();
   }

});

Chris from Err the blog, mentioned that he was excited about seeing LowPro
being ported to JQuery, he just whished you were using click instead of
onclick.

I'm personally really excited, especially with the new Merb release coming
up, I believe JQuery will grow in the Ruby community. I'll do my best to try
to see if I can come up with behaviors.

-Matt

On 1/28/08, Dan Webb <d...@danwebb.net> wrote:

> On 1/28/08, Peter <peter.kielt...@gmail.com> wrote:
> > ... I like jQuery, and I'd prefer to use it because of its adoption
> > and support, but from this small subset of a test, it does not perform
> > well at all. Reading the jQuery blog, they've taken on a developer to
> > optimize their code, I'm looking forward to seeing what they come up
> > with.

> From looking at that there's not a huge amount in it.  In my
> experience, since all the selector engines jumped up in performance a
> while ago framework speed is not a problem.  High performance is
> normally achieved at application level.  Doing things like using event
> delegation, lazy evaluation and generally writing code in a way that
> makes for the least amount of work possible is what really counts.
> Even before the selector speed up it wasn't a huge problem - you just
> needed to be careful with what selectors you used.  However, I say
> this from my experience.  So although I work on a lot of pretty JS
> heavy applications I've never felt the need to write a raytracer in JS
> or something similar.

> But yeah, back to the original point.  If you do like Mootools and
> want to port Low Pro then that would be cool.  It's already got a
> class implementation which is most of what Low Pro JQ's code is so its
> probably going to be very simple to do.

> Cheers,

> --
> Dan Webb
> http://www.danwebb.net

> aim: danwrong123
> skype: danwrong


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google