[wp-trac] [WordPress Trac] #18590: Swap out "return false" JS calls for preventDefault
WordPress Trac
wp-trac at lists.automattic.com
Mon Sep 5 03:43:16 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 | Keywords: needs-patch
----------------------------+-----------------------------
While trying to hook into someone clicking the expand/collapse arrow in
the nav menu UI, I realized that the existing Javascript is using `return
false;` to abort the hyperlink click from going through.
[http://fuelyourcoding.com/jquery-events-stop-misusing-return-false/ This
is bad and incorrect.]
We should be using `object.preventDefault()` instead so that other bound
functions aren't aborted.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18590>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list