Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#2166 closed bug (invalid)

Bind error injecting jQuery

Reported by: sullof Owned by:
Priority: minor Milestone: 1.2.4
Component: event Version: 1.2.2
Keywords: bind Cc:
Blocked by: Blocking:


PassPack autologin button doesn't work with some websites because jQuery fails to manage events.

Consider, for example, http://www.digg.com. If you run the following code with Firebug to inject jQuery into a page:

var s1=document.createElement('script');

and after the following:

jQuery(document).click(function(e) {

you can view that clicking on body of Digg.com, it alerts 1. But, if you try it, for example, on http://www.reddit.com, the bind fails. It produces an error connected to the following jQuery code:

// Handle event binding
jQuery.fn[name] = function(fn){
return fn ? this.bind(name, fn) : this.trigger(name);

Note that with versions of jQuery < 1.2 it worked well.

Change History (6)

comment:1 Changed 15 years ago by davidserduke

Priority: majorminor

This appears to be related to #844. I expect a much simpler test case will be necessary to debug it.

comment:2 Changed 15 years ago by davidserduke

Is bind a reserved word in Prototype? It looks like their bind is overwriting ours or something. Every function appears to have bind(), extend(), and toJSONString() attached to it.

comment:3 Changed 15 years ago by sullof

If you take a free PassPack account, you can try to autologin on Reddit.com using the "PassPack It!" button. In this case, you can see that Firebug shows exactly the error of ticket #844. I remember that in september autologin worked well on reddit.com, so I suppose that the problem is related to recent version of Prototype.

comment:4 Changed 15 years ago by sullof

I think that the problem is not related to Prototype itself. In fact, Twitter uses Prototype but in this case all works perfectly.

comment:5 Changed 15 years ago by brandon

This seems to be caused by Prototypes addition of a bind method to the native Function prototype.

comment:6 Changed 15 years ago by flesler

Resolution: invalid
Status: newclosed

Based on the ticket david linked (#844), this really is a prototype issue. Renaming the methods of Prototype seems to fix the issue (as someone said in the other ticket).

I think this doesn't need to be handled on our side, please try renaming Prototype's methods on your test case, and if the issue still arises.. reopen.

Note: See TracTickets for help on using tickets.