Hi,
It's it possible to have a real onload javascript option in the mimify settings?
I tried in generate_script_tag function of /wp-content/plugins/w3-total-cache/lib/W3/Plugin/Minify.php and it works
This way we can move the javascript after the onload event.
The js code for this option will be something like this
<script type="text/javascript">
function w3tc_load_js(scripturl) {
var element = document.createElement('script'); element.src = scripturl; document.body.appendChild(element);
}
function jsonload() { w3tc_load_js('_SCRIPT_URL_'); }
if (window.addEventListener) window.addEventListener('load', jsonload, false);
else if (window.attachEvent) window.attachEvent('onload', jsonload);
else window.onload = jsonload;
</script>
You can test this code in webpagespeed and check that document load is faster with this method.
Best regards,