Closed fi3ework closed 6 years ago
function async(u, c) { var d = document, t = 'script', o = d.createElement(t), s = d.getElementsByTagName(t)[0]; o.src = '//' + u; if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); } s.parentNode.insertBefore(o, s); }
usage
async('snapabug.appspot.com/snapabug.js', function() { SnapABug.init('XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'); });
ref: Asynchronous Script Loading Callback
usage
ref: Asynchronous Script Loading Callback