1loading = setInterval(function () {
2 if (document.getElementById("myElement")) {
3 // Element Has Loaded, Put your code here!
4 clearInterval(loading);
5 }
6}, 100); // Checks every 100ms(0.1s)
1var checkExist = setInterval(function() {
2 if ($('#my-element').length) {
3 console.log("Exists!");
4 clearInterval(checkExist);
5 }
6}, 100); // check every 100ms
7