Created
July 17, 2014 07:18
-
-
Save velyo/ab26bf42536a3faedae8 to your computer and use it in GitHub Desktop.
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
function ShopAsyncQueue() { | |
this.push = function () { | |
for (var i = 0; i < arguments.length; i++) { | |
try { | |
if (typeof arguments[i] === "function") arguments[i](); | |
else { | |
// TODO | |
} | |
} | |
catch (e) { | |
if (console) console.warn(e.message); | |
} | |
} | |
}; | |
}; | |
window.onload = function () { | |
// execute async queue on load finished | |
var _q = q; | |
window._saq = new ShopAsyncQueue(); | |
window._saq.push.apply(window._saq, _q); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment