Created
December 13, 2012 17:16
-
-
Save hugodias/4278062 to your computer and use it in GitHub Desktop.
How to Defer parsing javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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