Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

defer parsing of javascript avada

function defer_parsing_of_js( $url ) {
    if ( is_user_logged_in() ) return $url; //don't break WP Admin
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );
Comment

PREVIOUS NEXT
Code Example
Javascript :: variable javascript 
Javascript :: repeat string in javascript 
Javascript :: compare strings js 
Javascript :: get url 
Javascript :: function prototype javascript 
Javascript :: check web3 metamask disconnect 
Javascript :: string to uppercase 
Javascript :: complete ajax request jquery php call | ajax request 
Javascript :: print an object in javascript 
Javascript :: browseranimationsmodule browsermodule has already been loaded 
Javascript :: javascript close app phonegap 
Javascript :: angular 12 tabs 
Javascript :: performing query with sequelize includes 
Javascript :: render image in vue 
Javascript :: how to get the value of textarea in react 
Javascript :: accordion reatjs 
Javascript :: react window.addEventListener 
Javascript :: Adding User And Hashed Password In ExpressJS 
Javascript :: stack example in javascript 
Javascript :: react native diasble view 
Javascript :: javascript objects 
Javascript :: replace characters form array 
Javascript :: get total pairs from integer array javascript 
Javascript :: multi-dimensional array js 
Javascript :: node fs existssync 
Javascript :: jQuery DataTables Checkboxes 
Javascript :: react usememo 
Javascript :: electron js production release Distributing 
Javascript :: position of the mouse cursor javascript 
Javascript :: hostlistener 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =