Minimize Javascript/HTML Problem
-
Currently when enabling the minimize js and html option, inline comments i.e. “//hello” do not get stripped and so any code after the inline comment gets commented out as well.
This is currently causing a problem with wp_customize_support_script() which adds this script to the page:
<script type=”text/javascript”>
(function() {
var request, b = document.body, c = ‘className’, cs = ‘customize-support’, rcs = new RegExp(‘(^|\\s+)(no-)?’+cs+'(\\s+|$)’);
request = true;
b[c] = b[c].replace( rcs, ‘ ‘ );
// The customizer requires postMessage and CORS (if the site is cross domain)
b[c] += ( window.postMessage && request ? ‘ ‘ : ‘ no-‘ ) + cs;
}());
</script>As you can see in the above code when minified to one line,
“b[c] += ( window.postMessage && request ? ‘ ‘ : ‘ no-‘ ) + cs;
}());”
gets commented out
- The topic ‘Minimize Javascript/HTML Problem’ is closed to new replies.