[wp-trac] [WordPress Trac] #22307: Twenty Twelve: JavaScript error if navigation wrapper markup is removed from header

WordPress Trac noreply at wordpress.org
Fri Nov 9 13:25:07 UTC 2012


#22307: Twenty Twelve: JavaScript error if navigation wrapper markup is removed
from header
---------------------------+------------------
 Reporter:  sswells        |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  3.5
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |
---------------------------+------------------

Comment (by georgestephanis):

 I was thinking along the same lines.  We shouldn't assume things, and be
 okay with breaking if it happens to change.  JS breaking on load from this
 can be a pretty big deal to some sites -- sliders may not work, layouts
 may not load, event listeners may not attach.

 Reaching out and grabbing an element from the DOM and doing stuff to it in
 the same line, without making sure it exists first, is like ... in PHP,
 grabbing a global, and calling a method on it, without making sure the
 global is even an object or would have that method.

 +1 for verifying what we're grabbing and not making assumptions --
 especially as it's a pretty easy ifcheck to slip in.

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


More information about the wp-trac mailing list