Skip to content

Instantly share code, notes, and snippets.

@toandv
Created January 28, 2018 03:58
Show Gist options
  • Save toandv/ebdd480f6ab5d8b819b21e04efb4f855 to your computer and use it in GitHub Desktop.
Save toandv/ebdd480f6ab5d8b819b21e04efb4f855 to your computer and use it in GitHub Desktop.
function waitForEl(selector, callback){
var poller1 = setInterval(function(){
$jObject = jQuery(selector);
if($jObject.length < 1){
return;
}
clearInterval(poller1);
callback($jObject)
},100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment