jeudi 30 mai 2019

js doesn't execute 'else' statement

I have an if-else statement in JavaScript which returns false, but doesn't execute the code inside 'else'.

part of the script inside the cshtml file:

if (@Session["mission"].ToString() != "1") {
    setInterval(function () { myTimer(ctxPoints, ctxLines); }, 1000 / @ViewBag.rate);  
} else {
    alert("hi");
}

In the debug the '@Session["mission"].ToString() != "1"' statement returns false, but nothing jumps to the screen.




Aucun commentaire:

Enregistrer un commentaire