Last active
September 10, 2016 06:37
-
-
Save ZeRRoCull/88bb65f0b09368ec7dbd2fc48753d054 to your computer and use it in GitHub Desktop.
Оптимизированная загрузка JS-библиотек
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>var scr = {"scripts":[ | |
{"src" : "js/libs.min.js", "async" : false}, | |
{"src" : "js/common.js", "async" : false} | |
]};!function(t,n,r){"use strict";var c=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return!1;for(var r=0;r<t.length;r++){var c=n.createElement("script"),e=t[r];c.src=e.src,c.async=e.async,n.body.appendChild(c)}return!0};t.addEventListener?t.addEventListener("load",function(){c(r.scripts);},!1):t.attachEvent?t.attachEvent("onload",function(){c(r.scripts)}):t.onload=function(){c(r.scripts)}}(window,document,scr); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment