Execute Javascript String using setTimeout

sandeepkamboj12

Sandeep kamboj

Posted on July 11, 2018

Execute Javascript String using setTimeout

window.sum=0;

window.ExecuteJavascriptString = function()
{

    var data = "var a=3;"+
       "var b=4;"+
       "sum=a+b;"+
       "ShowResult()";
    setTimeout(data, 1);
}
ExecuteJavascriptString();  


window.ShowResult = function(){
    console.log(sum);
    alert(sum);
}

💖 💪 🙅 🚩
sandeepkamboj12
Sandeep kamboj

Posted on July 11, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related