카테고리 없음
자동 웹 페이지 리로드 reload
xemaker
2017. 2. 3. 04:45
파싱을 하거나 기타의 이유로 주기적으로 특정 웹페이지를 실행해야할 경우가 있을경우 아래의 코드를 쓰면 된다.
아래코드 처럼 작성하고 그냥 웹 브라우저를 띄워놓기만 하면 된다.
밀리 세컨드라 1000이면 1초다.
아래처럼 10*1000 하면 1초의 10배 측 10초다.
60*1000 하면 60초 즉, 1분이다.
따라서 원하는 기간을 위에처럼 작성하면 된다.
<script type="text/javascript">
setTimeout(function(){
location.reload();
},10*1000);
</script>
<iframe src="http://aa.com">
</iframe>
원하는 php 화면이 있을경우에도 마찬가지로 구현할 수 있다.
<script type="text/javascript">
setTimeout(function(){
location.reload();
},10*1000);
</script>
<iframe src="http://localhost/sc_sports.php">
</iframe>