Created
February 18, 2017 18:48
-
-
Save BKeanu1989/5755211391572cdc31499bfe3ecddb91 to your computer and use it in GitHub Desktop.
Wait for element to appear, setTimeout
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 waitForElementToAppear(selector, time) { | |
if(document.querySelector(selector)!=null) { | |
alert("The element is displayed, you can put your code instead of this alert."); | |
return; | |
} | |
else { | |
setTimeout(function() { | |
waitForElementToAppear(selector, time); | |
}, time); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment