twentyfifteen_javascript_detection

JavaScript Detection.

Description

twentyfifteen_javascript_detection(); 

Adds a js class to the root element when JavaScript is detected.


Usage

  1. if ( !function_exists( 'twentyfifteen_javascript_detection' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyfifteen_javascript_detection(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function twentyfifteen_javascript_detection() { 
  2. echo "<script>(function(html) {html.className = html.className.replace(/\bno-js\b/, 'js')})(document.documentElement);</script>\n";