Side navigation
#13201 closed bug (notabug)
Opened January 12, 2013 11:47AM UTC
Closed January 12, 2013 02:51PM UTC
Last modified January 13, 2013 09:20AM UTC
unbind click error
Reported by: | pixecs1 | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hello, i created a sample page to show a little bug when unbinding a event. When "$this.unbind('click');" is commented the code work as expected
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Freelancer projects</title> <script type="text/javascript" src="http://code.jquery.com/jquery.js"></script> </head> <body> <div id="MainDiv"> <a href="javascript:void(0)">Button 1</a> <a href="javascript:void(0)">Button 2</a> <a href="javascript:void(0)">Button 3</a> </div> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('#MainDiv a').unbind('click').bind('click', function(){ var $Button = jQuery(this); jQuery('#MainDiv a').each(function(){ var $this = jQuery(this); //console.log($this[0] != $Button[0]); if($this[0] != $Button[0]) { $this.unbind('click'); $this.removeClass('pbbutton_blue'); } }); }) ; }); </script> </body> </html>
Attachments (0)
Change History (2)
Changed January 12, 2013 02:51PM UTC by comment:1
resolution: | → notabug |
---|---|
status: | new → closed |
Changed January 13, 2013 09:20AM UTC by comment:2
Replying to [comment:1 dmethvin]:
Please ask for help on the forum. You're misunderstanding the meaning of equality.
Hello, i'm not misunderstanding the equality (it's checking if the source html elemets are the same), and my point is that the $this.unbind('click'); line trigger a crash on line 1719 in jquery source.
Please ask for help on the forum. You're misunderstanding the meaning of equality.