Last active
December 18, 2015 17:49
-
-
Save peterwilsoncc/5820756 to your computer and use it in GitHub Desktop.
Async JS loader
This file contains hidden or 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
PWCC = this.PWCC || {}; | |
console = this.console || {}; | |
console.log = this.console.log || function(){}; | |
console.error = this.console.error || function(){}; | |
(PWCC.exe = function(window, document, $) { | |
var html = document.documentElement, | |
body = html.getElementsByTagName('body')[0]; | |
load_async('/path/to/sync.js'); | |
function load_async(script_src) { | |
var S = 'script', | |
i=document.createElement(S), | |
f=document.getElementsByTagName(S)[0]; | |
i.async = i.src = script_src; | |
f.parentNode.insertBefore(i, f); | |
} | |
})(this, document, jQuery); |
This file contains hidden or 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
PWCC = this.PWCC || {}; | |
(PWCC.async = function(window, document, $) { | |
var html = document.documentElement, | |
body = html.getElementsByTagName('body')[0]; | |
})(this, document, jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment