Skip to content

Instantly share code, notes, and snippets.

@hugodias
Created December 13, 2012 17:16
Show Gist options
  • Save hugodias/4278062 to your computer and use it in GitHub Desktop.
Save hugodias/4278062 to your computer and use it in GitHub Desktop.
How to Defer parsing javascript
<script defer="defer" type="text/javascript">
window.onload=function(){
var mycode;
mycode=document.createElement("script");
mycode.type="text/javascript";
mycode.src="<?php bloginfo('template_url') ?>/js/your_script.js";
document.getElementsByTagName("head")[0].appendChild(mycode);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment