Skip to content

Instantly share code, notes, and snippets.

@madeindjs
Created December 2, 2016 14:28
make script execution wait until jquery is loaded
function defer(method) {
if (window.jQuery)
method();
else
setTimeout(function() { defer(method) }, 50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment