Tagged: javascript
Hello!
It implemented this code to defer parsing of javascript. Normally it works just fine.
But now it messes with the mega menu. it moves the menu to the left.
any ideas?
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, ‘.js’ ) ) return $url;
if ( strpos( $url, ‘jquery.js’ ) ) return $url;
return “$url.’ async onload=’myinit()”;
}
add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );
Hi WolfvanHaeren,
Not sure why but I’m guessing it’s causing some kind of conflict, what is the purpose of the code? I’m not what defer parsing means?
Best regards,
Rikard
It makes sure the javascript is loaded when it is being used and not all the javascript at once.
It used to work fine.