아래와같이 매개변수를 넣은 함수를 1분마다 실행시키려고 아래와같이 작성했는데
처음 한번만 실행되고 interval 이 작동안됐다
setInterval(update_charts(itvParam), delayChart);
이유는 함수를 그대로 인자로 전달했어야하는데
나는 호출을 한것이다.
그래서 아래와같이 수정했다.
setInterval(function() {
update_charts(itvParam);
}, delayChart);
반응형
'웹 개발 > 🌐 JavaScript' 카테고리의 다른 글
JQMIGRATE:jQuery.fn.load() is deprecated 해결 (0) | 2024.08.27 |
---|---|
eChart 메모리 누수 잡는법 (0) | 2024.08.22 |
JS | 특정 태그의 자식 태그 개수를 파악하는 법 (0) | 2024.07.01 |
간단한 로딩기능 구현 (0) | 2024.06.10 |
JS | eCharts 사용시 echarts.js:2286 Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload. 에러 (0) | 2024.04.03 |