Created
August 24, 2016 04:54
-
-
Save zeshanshani/ae686e35d3788e5a3b91a6a26927b668 to your computer and use it in GitHub Desktop.
Run a function multiple times until the element is found on the page
This file contains hidden or 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 runUACLCLoop() { | |
setTimeout(function() { | |
// Check if something is found on the page. | |
if ( jQuery('.class_name').is(':visible') ) { // change it to another condition | |
// Run the same function again to create the loop. | |
runUACLCLoop(); | |
// If nothing is found, then run the else statement. | |
} else { | |
setTimeout(function () { | |
// Do other great stuff here.... | |
}, 500); | |
} | |
}, 200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment