Make WordPress Core

Changeset 28598


Ignore:
Timestamp:
05/28/2014 01:35:47 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Twenty Fourteen: Avoid passing an empty string to document.getElementById().

props nabil_kadimi.
fixes #28340.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/js/functions.js

    r27627 r28598  
    4141     */
    4242    _window.on( 'hashchange.twentyfourteen', function() {
    43         var element = document.getElementById( location.hash.substring( 1 ) );
     43        var hash = location.hash.substring( 1 ), element;
     44
     45        if ( ! hash ) {
     46            return;
     47        }
     48
     49        element = document.getElementById( hash );
    4450
    4551        if ( element ) {
Note: See TracChangeset for help on using the changeset viewer.