Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to wait until a variable is set javascript

function waitForElement(){
    if(typeof someVariable !== "undefined"){
        //variable exists, do what you want
    }
    else{
        setTimeout(waitForElement, 250);
    }
}
 
PREVIOUS NEXT
Tagged: #wait #variable #set #javascript
ADD COMMENT
Topic
Name
9+1 =