<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Timer</title>

<script type = "text/javascript">

console.log('Begin js');

function viewContent()

{

document.write('<br/>Actually nothing to show...<br/>');

}

var timeCount = 0;

function calTime()

{

timeCount ++;

if(timeCount < 5)

{

document.write(timeCount + 'secends...<br/>');

}

else 

{

document.write('Time out !<br/>');

window.clearInterval(countTimer);

}

}

var timer = window.setTimeout('viewContent()', 5000);

var countTimer = window.setInterval('calTime()', 1000);

console.log('End js');

</script>

</head>

<body>

<h3>Timer</h3>

<p>다음내용은 5초후 공개됩니다.</p>

</body>

</html>


6-3_Timer.html


반응형

'Programming > JavaScript' 카테고리의 다른 글

[JavaScript] 6-5_history.js  (0) 2016.12.07
[JavaScript] 6-4_location.html  (0) 2016.12.07
[JavaScript] 6-2_Navitator.js  (0) 2016.12.07
[JavaScript] 6-1_BrowserControl.js  (0) 2016.12.07
[JavaScript] 6-0_BrowserControl.html  (0) 2016.12.07

var borwserInfo = null;


browserInfo = navigator.userAgent;


document.write('Information of current browser : ' + browserInfo);



반응형

'Programming > JavaScript' 카테고리의 다른 글

[JavaScript] 6-4_location.html  (0) 2016.12.07
[JavaScript] 6-3_Timer.html  (0) 2016.12.07
[JavaScript] 6-1_BrowserControl.js  (0) 2016.12.07
[JavaScript] 6-0_BrowserControl.html  (0) 2016.12.07
JavaScript 소스코드  (0) 2016.12.07

var popupWin = null;


//명령을 모아놓은 객체

var commendList = 

{

//윈도우를 생성해 객체를 연다.

open: function(url)

{

console.log(url);

if(!url)

{

url = 'about/blank';

}

popupWin = window.open(url, 'popup', 'width = 100, height = 100');

document.write(url + ' 웹사이트 팝업<br/>') ;

},

//생성된 객체를 닫는다.

close: function()

{

if(popupWin)

{

popupWin.close();

popupWin = null;

document.write('팝업 윈도우 닫기<br/>');

}

else

{

document.write('팝업 윈도우가 없음<br/>');

}

}

}


//Set true to testing

while(false)

{

var commend = prompt('명령어 + URL\n종료 : exit');

if(commend === 'exit' || commend ==='')

{

break;

}

else if (commend)

{

var commends = commend.split(' ');

if(commends.length ===1)

{

commendList[commend]();

}

else

{

var commend = commends[0];

var args = commends[1];

commendList[commend](args);

}

}

else

{

document.write('Commend was wrong!<br/>');

}

}




반응형

'Programming > JavaScript' 카테고리의 다른 글

[JavaScript] 6-3_Timer.html  (0) 2016.12.07
[JavaScript] 6-2_Navitator.js  (0) 2016.12.07
[JavaScript] 6-0_BrowserControl.html  (0) 2016.12.07
JavaScript 소스코드  (0) 2016.12.07
[JavaScript] 5-3_simulation.js  (0) 2016.12.07

+ Recent posts