Re:Why jQuery.proxy rocks my world
by gmac on Wednesday April 27, 2011 @06:09AM
(#2488956)
Since the app is apparently written using backbone.js, the _.bindAll method would be a neater solution here (as I see one of the commenters on the post points out).
[ Parent
| on HN ]
Right, You may want to prefer using _.bind and _.bindAll to jQuery.proxy, because the Underscore functions delegate to the native Function.prototype.bind, if it exists.
Other parts of the app use Backbone.
FBNotificationWatcher is a simple implementation based on JS.Class - http://jsclass.jcoglan.com/classes.html
JSClass seems to provide this too :) http://jsclass.jcoglan.com/binding.html
Re:Why jQuery.proxy rocks my world
by cominatchu on Wednesday April 27, 2011 @09:05AM
(#2489305)
If underscore is already loaded into the browser cache for other pages then you should be able to use it for free here then and not need jquery.proxy