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
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 15362
    
    6
Use a closure



Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56529
    
  14

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: 15362
    
    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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: jQuery Equivalent of Prototype Function.bind
 
Similar Threads
How to create clickable list
Handling events in Javascript
java/ajax/servlets/javascript jambalaya
AJAX XMLHttpRequestObject Question?
Dojo vs. DWR