Author: mdale
Description:
You have the code:
// Marker element for adding dynamic styles
var $marker = $( 'head meta[name=ResourceLoaderDynamicStyles]' );
You should instead have:
var $marker = null and then use this.getCssMarker() or getCssMarker() and locally cache the selector so you can lazy initialize the target ( and do things like add the target to the page if its missing )
something like:
Marker element for adding dynamic styles
var $marker = null ; lazy init
var getMarker = function(){
if( $marker ){
return $marker;
}
$marker = $( 'head meta[name=ResourceLoaderDynamicStyles]' )
if( ! $marker.length ){
$marker = $( '<meta />').attr( 'name', 'ResourceLoaderDynamicStyles' )
.appendTo( 'head' );
}
return $marker;
};
Version: unspecified
Severity: enhancement