Skip to content

Instantly share code, notes, and snippets.

@maztch
Created June 7, 2018 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maztch/86f3988848f366b66b5d80038c5282fc to your computer and use it in GitHub Desktop.
Save maztch/86f3988848f366b66b5d80038c5282fc to your computer and use it in GitHub Desktop.
wait for jquery on async load (or other class)
function doSomething() {
console.log('do something with jQuery');
}
var waitInterval = window.setInterval(function () {
try {
if (jQuery === 'function') {
clearInterval(waitInterval);
doSomething();
}
}
catch
(e) {
}
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment