Created
June 7, 2018 09:20
-
-
Save maztch/86f3988848f366b66b5d80038c5282fc to your computer and use it in GitHub Desktop.
wait for jquery on async load (or other class)
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 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