[wp-trac] [WordPress Trac] #22307: Twenty Twelve: JavaScript error if not removed navigation wrapper markup (was: Twenty Twelve: Javascript error if not using nav)

WordPress Trac noreply at wordpress.org
Mon Oct 29 18:51:41 UTC 2012


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

 * keywords:  needs-testing => needs-patch


Old description:

> I'm getting this error on a page that isn't using the header or nav.
>
> Error: TypeError: document.getElementById("site-navigation") is null
> Source File: /wp-content/themes/twentytwelve/js/navigation.js?ver=1.0
> Line: 7
>
> Can a check be added into the Twenty Twelve theme to make sure #site-
> navigation exists on the page?

New description:

 I'm getting this error on a page that isn't using the header or nav. [Edit
 by lancewillett: This only occurs when the entire nav markup is removed.]

 {{{
 Error: TypeError: document.getElementById("site-navigation") is null
 Source File: /wp-content/themes/twentytwelve/js/navigation.js?ver=1.0
 Line: 7
 }}}

 Can a check be added into the Twenty Twelve theme to make sure #site-
 navigation exists on the page?

--

Comment:

 I was able to repeat, but only when removing the entire navigation markup
 -- not just without a navigation menu since that case was already heavily
 tested and accounted for.

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


More information about the wp-trac mailing list