5 초 카운트 다운으로 페이지를 리디렉션하려고하지만 사용자가 countdwn을 취소하고 페이지에 머물러 있어야합니다. 여기 내 HTML카운트 다운 및 취소 옵션을 사용하여 Javascript로 리디렉션 페이지
var targetURL="http://javascriptkit.com";
var countdownfrom=10;
var currentsecond=document.redirect.redirect2.value=countdownfrom+1;
function countredirect(){
if (currentsecond!=1){
currentsecond-=1;
document.redirect.redirect2.value=currentsecond;
}
else{
window.location="WWW.google.com";
return;
}
setTimeout("countredirect()",1000)
}
countredirect();
참고 자바 스크립트 여기
<form name="redirect">
<center>
<font face="Arial"><b>You will be redirected to the script in<br><br>
<form>
<input type="text" size="3" name="redirect2">
</form>
seconds</b></font>
</center>
하고있다 : 나는 실제로 팝업 상자에하고 싶었던와 함께 버튼을 취소
그래서 발견 한 그 오래된 코드에 어떤 문제가 있습니까? 문제를 해결하기 위해 시도한 것은 무엇입니까? [Java는 JavaScript가 아닙니다. 이에 따라 주제 태그를 편집했습니다. ] 당신은 어떤 jQuery도 가지고 있지 않습니다.] –