File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes jQuery Equivalent of Prototype Function.bind  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jQuery Equivalent of Prototype Function.bind  " Watch "jQuery Equivalent of Prototype Function.bind  " New topic
Author

jQuery Equivalent of Prototype Function.bind

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Is there a jQuery way of doing this Prototype bind?




Thanks.

BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Use a closure



Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60049
    
  65

Remember that the purpose of Prototype is to make JavaScript as OO as possible, while jQuery uses JavaScript as itself. As such, Prototype defined .bind() to allow people to not have to really learn how JavaScript works (and thus avoid closures).

While that may have some appeal to some folks, I think it quickly becomes very limiting.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks Eric. closure is cool.
Thanks for the book Ajax In Action too. I have both editions. Any new version?
Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60049
    
  65

Bruce Jin wrote:Thanks for the book Ajax In Action too. I have both editions. Any new version?

Ajax in Action only has a single edition. At one time, Manning planned for a 2nd edition, but there are no current plans for a second.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks bear.
I messed up Ajax in Practice with Ajax in Action 2. Thanks for been the author!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
No plans on Ajax In Action 2nd ed. we talked about it, but choose not too after long discussions.

I am working on two separate projects now. TOP SECRET.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jQuery Equivalent of Prototype Function.bind
 
Similar Threads
How to create clickable list
Handling events in Javascript
Dojo vs. DWR
AJAX XMLHttpRequestObject Question?
java/ajax/servlets/javascript jambalaya