[jQuery] jQuery and OOP
[jQuery] jQuery and OOP
That is really nice and handy you wrote :), but I am writing a complex ajax application. I just created a simple scenario to show what I want. So yes, I really need it.
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On Behalf Of Michael Geary
Sent: Tuesday, October 24, 2006 4:23 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] jQuery and OOP
Do you really need an object at all? This (pun intended) would do the same
thing as all the code you listed:
$(function() {
var $btn = $('#btnCounter'), nr = 0;
$btn.click( function() {
$btn.attr( 'value', nr++ );
});
});
-Mike