[wp-trac] [WordPress Trac] #18590: Swap out "return false" JS calls for preventDefault

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 5 19:07:15 UTC 2011


#18590: Swap out "return false" JS calls for preventDefault
----------------------------+------------------------------
 Reporter:  Viper007Bond    |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.3
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |
----------------------------+------------------------------

Comment (by Viper007Bond):

 Replying to [comment:2 azaozz]:
 > We are (should be) using `return false` to do both which is usually the
 case. Note that this doesn't stop the 'immediate propagation', i.e. if
 there are several 'click' handlers on the same element they all fire.

 Yes, if my code does `$('#foo').click( ... )` it will work, but the
 `return false` blocks `$('#foo').live('click', ... )` from working (i.e.
 attaching the click event to subsequently added items).

 I ended up having to use `$('#foo').live('mouseover', ...)` to hack around
 it.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18590#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list