홈피에 머문시간을 상태표시줄에 보여주기
본문
<head>와 </head> 사이에 아래소스 삽입
그리고 <body> 태그에 <body onload="browsing_time()"> --> 요런식으로 추가
========================================================
<script LANGUAGE="JavaScript">
<!--
/*
JavaScript coded in full by Craig McKinnon
http://www.WarpLink.com/~sandym
sandym@WarpLink.com
*/
var min_inc = 0, sec_inc = -1;
function browsing_time()
{
if (sec_inc == 59) min_inc++;
sec_inc = (sec_inc + 1) % 60; // reset sec_inc to 0 after 59 seconds
// Display "minutes" or "minute" (<-- for 1 minute and second)
// and proper 0's
if (min_inc == 1)
var min_no = min_inc + ' minute';
else var min_no = min_inc + ' minutes';
if (sec_inc >= 10)
var sec_no = sec_inc;
else var sec_no = '0' + sec_inc;
var sec_txt = ' seconds.';
if (sec_inc == 1)
sec_txt = ' second.';
var elapsed = '홈피에 머문 시간은 ' + min_no + ' '+ sec_no + sec_txt;
defaultStatus = elapsed;
setTimeout("browsing_time()", 1000);
}
// -->
</script>
출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=104
그리고 <body> 태그에 <body onload="browsing_time()"> --> 요런식으로 추가
========================================================
<script LANGUAGE="JavaScript">
<!--
/*
JavaScript coded in full by Craig McKinnon
http://www.WarpLink.com/~sandym
sandym@WarpLink.com
*/
var min_inc = 0, sec_inc = -1;
function browsing_time()
{
if (sec_inc == 59) min_inc++;
sec_inc = (sec_inc + 1) % 60; // reset sec_inc to 0 after 59 seconds
// Display "minutes" or "minute" (<-- for 1 minute and second)
// and proper 0's
if (min_inc == 1)
var min_no = min_inc + ' minute';
else var min_no = min_inc + ' minutes';
if (sec_inc >= 10)
var sec_no = sec_inc;
else var sec_no = '0' + sec_inc;
var sec_txt = ' seconds.';
if (sec_inc == 1)
sec_txt = ' second.';
var elapsed = '홈피에 머문 시간은 ' + min_no + ' '+ sec_no + sec_txt;
defaultStatus = elapsed;
setTimeout("browsing_time()", 1000);
}
// -->
</script>
출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=104
관련링크
댓글목록
등록된 댓글이 없습니다.