Skip to main content

Bug Tracker

Side navigation

#12188 closed bug (wontfix)

Opened August 03, 2012 09:42AM UTC

Closed August 03, 2012 01:46PM UTC

Strange JQuery behaviour with global Object extension and event triggers

Reported by: tinnerdxp Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hello,

It's my first report - so please feel free to correct me as much as you can.

I've noticed a strange behaviour of JQuery core v1.7.2 (and older versions).

When I dynamically build an element $('<a>') and dynamically attach event to it through either .bind() or .click() and have generic Object object extended to have a method (doesn't matter what method and what it does) it seems that JQuery is triggering that method for ALL "click" events. To make things worse, if the extended method signature uses a parameter it causes JQuery to error out completely.

This "works" and demonstrates the function to be executed every time:
http://jsfiddle.net/tinnerdxp/AU4pm/

This "doesn't work" and errors out:
http://jsfiddle.net/tinnerdxp/Pvax2/

kind regards

tinnerdxp

Attachments (0)
Change History (1)

Changed August 03, 2012 01:46PM UTC by rwaldron comment:1

resolution: → wontfix
status: newclosed