Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
$$, the each function and binding
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Abbas  
View profile  
 More options Nov 5, 5:37 am
From: Abbas <ab_gad...@yahoo.com>
Date: Thu, 5 Nov 2009 02:37:38 -0800 (PST)
Local: Thurs, Nov 5 2009 5:37 am
Subject: $$, the each function and binding
Hi,
I encountered a scenario wherin if i do

$$(some selector).each(function(node){
    someFunction(node, this)

}).bind(this)

, the 'this' object within someFunction() is not the original context
that i bound the 'each' function to.

Can you please explain?
Thanks


    Reply    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.
T.J. Crowder  
View profile  
 More options Nov 6, 8:45 am
From: "T.J. Crowder" <t...@crowdersoftware.com>
Date: Fri, 6 Nov 2009 05:45:26 -0800 (PST)
Local: Fri, Nov 6 2009 8:45 am
Subject: Re: $$, the each function and binding
Hi,

You're calling #bind on the return value from #each, which is
incorrect -- #each returns the enumerable object, which doesn't have a
#bind method.

What you're looking for is the second _parameter_ to #each, details in
the docs[1].

[1] http://api.prototypejs.org/language/enumerable.html#each-instance_method

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com

On Nov 5, 10:37 am, Abbas <ab_gad...@yahoo.com> wrote:


    Reply    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.
End of messages
« Back to Discussions « Newer topic     Older topic »

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