head.php 에 넣는 자바스크립트

head.php 에 숫자가 하나씩 내려가는 카운트다운 타이머를 자바스크립트로 만들었습니다.
잘동 잘 되고 디스플레이도 참 잘되는데요..

유독 이상하게
게시판 write 페이지 볼때만 아예 안뜨는문제는 뭘까요..;;;
list랑 view볼때는 잘 나옵니다...... ㅜㅜ

베리어블 이름도 안겹치게 복잡한거 만들었고요
js 파일 임풀트도 잘 되어있고요...

도대체 list랑 view 볼때는 잘나오는데 write 볼때는 안나오는 이유가 뭘까요..?? ㅠㅠ

도와주세요 write 페이지 볼때 불러와지는 자바스크립트 펑션이 겹치는거같은데
뭔지 모르곘습니다 ㅠㅠ


[code]
window.onload=WindowLoad;
function WindowLoad(event) {
ActivateCountDown("CountDownPanel", 100);
}

var _countDowncontainer=0;
var _currentSeconds=0;

function ActivateCountDown(strContainerID, initialValue) {
_countDowncontainer = document.getElementById(strContainerID);

if (!_countDowncontainer) {
alert("count down error: container does not exist: "+strContainerID+
"\nmake sure html element with this ID exists");
return;
}

SetCountdownText(initialValue);
window.setTimeout("CountDownTick()", 1000);
}

function CountDownTick() {
if (_currentSeconds <= 0) {
alert("your time has expired!");
return;
}

SetCountdownText(_currentSeconds-1);
window.setTimeout("CountDownTick()", 1000);
}

function SetCountdownText(seconds) {
//store:
_currentSeconds = seconds;

//get minutes:
var minutes=parseInt(seconds/60);

//shrink:
seconds = (seconds%60);

//get hours:
var hours=parseInt(minutes/60);

//shrink:
minutes = (minutes%60);

//build text:
var strText = AddZero(hours) + ":" + AddZero(minutes) + ":" + AddZero(seconds);

//apply:
_countDowncontainer.innerHTML = strText;
}

function AddZero(num) {
return ((num >= 0)&&(num < 10))?"0"+num:num+"";
}

[/code]
|

댓글 1개

안나오는 페이지를 링크해 주시면 디버깅하는데 편리하겠네요 :)
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
15년 전 조회 819
15년 전 조회 3,505
15년 전 조회 1,578
15년 전 조회 1,125
15년 전 조회 999
15년 전 조회 1,080
15년 전 조회 1,574
15년 전 조회 1,083
15년 전 조회 2,694
15년 전 조회 1,217
15년 전 조회 1,002
15년 전 조회 1,558
15년 전 조회 1,025
15년 전 조회 1,911
15년 전 조회 2,319
15년 전 조회 2,371
15년 전 조회 1,555
15년 전 조회 2,154
15년 전 조회 1,802
15년 전 조회 1,637