On Jul 26, 12:40 pm, David Dashifen Kees <[EMAIL PROTECTED]> wrote:
> Tom Gregory wrote:
> > Try
> > onSuccess: function (t) { /* ... */ }.bind(this)

Bah!! I tried all sorts of variations with bind(). For example:

        recommend : function() {
                var url = this.recommend_button.href;
                new Ajax.Request(url, {
                        method: 'get',
                        onSuccess: function(transport) {
                                if (this.is_approved(transport.responseText)) {
                                        console.log('cool');
                                } else {
                                        console.log('uncool');
                                }
                        }.bind(this);
                });
                return false;
        },

^^ that implementation threw an error in Firefox. After removing the ;
after bind() everything works fine. Thanks for the help!

Greg


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to