onload() | addEventListener(load, ) |
attach event handler to the 'load' event of a web page or an image | |
can only handle one event handler at a time | can attach multiple event handlers |
removeEventListener() allow to remove the event listener later on can free up resources & prevent executing multiple times |
'FrontEnd > JavaScript' 카테고리의 다른 글
[ JavaScript ] 예외 처리 exception handling (1) | 2023.10.26 |
---|---|
[ JavaScript ] 2진수, 8진수, 10진수, 16진수 변환 방법 (feat. toString) (0) | 2023.10.25 |
[ JavaScript ] spread vs rest (feat. 비구조화 할당) (1) | 2023.10.25 |
[ JavaScript ] var vs let vs const (feat. 호이스팅, TDZ) (0) | 2023.10.25 |
[ JavaScript ] super() (feat. 클래스) (0) | 2023.10.25 |