javascript - How can I make a Combine.js file load async -


i have created combined.js file page inline , other scripts 1 file...

how can load these scripts asynchronously page? - have done because google , yahoo recommends speed-up website loading.

i have placed file in footer.php (i using wordpress using wp_enqueue_script) without async or defer tags, seem have hardcode these files?

in html5 can use 'async' attribute can see here support it:

<script async src="myjavascript.js"></script> 

the old way it, this:

<script>  var res = document.createelement('script');   res.src = "myjavascript.js";  var script = document.getelementsbytagname('script')[0];  script.parentnode.insertbefore(res, script); </script> 

this way has more support ever need.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -