Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Prototype + lowpro vs. JQuery

View Parsed - Show only message text

Received: by 10.35.126.2 with SMTP id d2mr12915504pyn.1.1201739475178;
        Wed, 30 Jan 2008 16:31:15 -0800 (PST)
Return-Path: <d...@danwebb.net>
Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.233])
        by mx.google.com with ESMTP id z53si4021607pyg.1.2008.01.30.16.31.15;
        Wed, 30 Jan 2008 16:31:15 -0800 (PST)
Received-SPF: neutral (google.com: 64.233.184.233 is neither permitted nor denied by best guess record for domain of d...@danwebb.net) client-ip=64.233.184.233;
Authentication-Results: mx.google.com; spf=neutral (google.com: 64.233.184.233 is neither permitted nor denied by best guess record for domain of d...@danwebb.net) smtp.mail=...@danwebb.net
Received: by wr-out-0506.google.com with SMTP id 69so463189wri.15
        for <low-pro@googlegroups.com>; Wed, 30 Jan 2008 16:31:15 -0800 (PST)
Received: by 10.150.58.5 with SMTP id g5mr384696yba.158.1201739474960;
        Wed, 30 Jan 2008 16:31:14 -0800 (PST)
Received: by 10.150.181.7 with HTTP; Wed, 30 Jan 2008 16:31:14 -0800 (PST)
Message-ID: <5b3e279f0801301631s159a4398hec1c474b1bf6f745@mail.gmail.com>
Date: Thu, 31 Jan 2008 00:31:14 +0000
From: "Dan Webb" <d...@danwebb.net>
To: low-pro@googlegroups.com
Subject: Re: Prototype + lowpro vs. JQuery
In-Reply-To: <f58d8dcb0801301555t268f7fa0gcc7438856abaea49@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <102c1a64-c792-46f5-95d0-202ce9fdbe3c@j78g2000hsd.googlegroups.com>
	 <f58d8dcb0801251938r688da9fex9992160b1b1ff195@mail.gmail.com>
	 <5b3e279f0801260204o7e8ecb37qd6c994c071274fad@mail.gmail.com>
	 <5b3e279f0801260630i58a84ef2u336f161f17d78ab6@mail.gmail.com>
	 <7438eebe0801261609g59af8c07hbe6f6e59256e0550@mail.gmail.com>
	 <b10d3fec-14ec-4eda-a57c-c82af44cc998@c23g2000hsa.googlegroups.com>
	 <5b3e279f0801280253l624c333avfc9f8d128f7055ff@mail.gmail.com>
	 <d667e999-d057-46a2-868f-236240f24d05@j78g2000hsd.googlegroups.com>
	 <5b3e279f0801280727r2a307962mf6955a96d12ca0bf@mail.gmail.com>
	 <f58d8dcb0801301555t268f7fa0gcc7438856abae...@mail.gmail.com>

> 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();
>  }
> });

Yeah, well, I've not ported any of that Low Pro at all.  I figure that
what you already get:

jQuery(function($) {
  $('div.product').click(function() { ..... });
  $('a').click(function() { ..... });
});

...is just as clean as Event.addBehavior.  I've basically just brought
across the behavior classes part.

>
> 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.

The on being at the start of methods that catch events is an important
part.  We need to differenciate which methods are intended to catch
events and which are just normal methods.  If we do this then behavior
classes can catch custom events as well which is a very good thing.

>
> 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.

Yeah, I'm liking how its turned out so far.  My only reservation is
that what behavior classes do can and is currently done using plugins:

$('input').attach(DatePicker);

could be done as:

$('input').attachDatePicker();

However, I think behavior classes have advantages over this method on
accounts that they are actual classes that you can inherit from and
augment yourself.  The only way you can customise plugins is to crack
open the source and change it which is never ideal.

Cheers,

Dan

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

aim: danwrong123
skype: danwrong

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