사용자가 프롬프트에 입력하는 매 n 초마다 확인 창을 표시하지만 입력에 관계없이 확인 창이 즉시 팝업되도록하려고합니다. 내가 도대체 뭘 잘못하고있는 겁니까?setInterval이 올바르게 작동하지 않습니다.
<button onclick="timer_prompt()">FUN</button>
내 간단한 기능 :
function timer_prompt()
{
var seconds = prompt("Enter Time Interval In Seconds Please");
seconds = seconds*1000;
if(seconds>0)
{
setInterval(confirm_timer(), seconds);
}
else
{
alert("You entered invalid content");
}
}
function confirm_timer()
{
confirm("YOU HAVE SET A TIMER!!!");
}
당신이 그것을 – A1rPun