jquery wait for element to exist
var checkExist = setInterval(function() {
if ($('#the-canvas').length) {
console.log("Exists!");
clearInterval(checkExist);
}
}, 100); // check every 100ms
//https://gist.github.com/chrisjhoughton/7890303
var waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {
waitForEl(selector, callback);
}, 100);
}
};
waitForEl(selector, function() {
// work the magic
});
Also in JavaScript:
- react JSON data to display in a table
- js outputting data
- react router url params
- how to hide header in react navigation
- js array add element
- Iterate with JavaScript For Loops
- sum elements in list with same name js
- avoid compressing imagepicker react native
- angular material
- how to make link in discord.js
- angular this web site use cookie example
- required false jquery
- sequelize and
- docker react
- javascript push all elements of array to another array
- jquery alert
- *args python javascript equivalent
- disable input jquery
- bash expression
- javascript get last url segment
- nestjs version
- change true to false js
- javascript sort array of ints
- js window location relative path