Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Unelegant Code
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:
Followup To:
Add Cc | Add Followup-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 you hear
 
John Resig  
View profile  
 More options Oct 3 2008, 1:50 pm
From: "John Resig" <jere...@gmail.com>
Date: Fri, 3 Oct 2008 13:50:10 -0400
Local: Fri, Oct 3 2008 1:50 pm
Subject: Re: [jquery-dev] Re: Unelegant Code

> I agree with you, just wanted to through some ideas into the mix, but
> do you agree that this is "unelegant code"

> $('#foo').fadeOut('normal',function(){ $(this).remove(); });

> Do you have any suggestions to improve it? I think the last option I
> provided is the most realistic and I think that making it clear that
> you may only apply a single jquery method without arguments is within
> reason. It is just a shortcut, and you can use a whole function
> wrapper if you want to do something else.

One idea that I had was a special jQuery object that produces a
wrapped function, something like:

$("#foo").fadeOut("normal", jQuery.self.remove());

More complicated:

$("#foo").fadeOut("normal",
  jQuery.self.hide("fast",
    jQuery.self.remove()));

That wouldn't be "that hard" to implement (imo) - any interest? I
could probably code something up if there is.

--John


 
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.