티스토리 뷰
window in Javascript
- 어디서든 접근이 가능한 전역객체
- browser window를 의미하고, browser window를 control 할 수있는 다양한 method 제공
- 내가 작성하는 코드들이 이 window object의 property가 된다. 그래서 특별한 경우를 제외하고는 window는 생략이 가능하다.
단, const와 let은 scope가 object내에 속하기에 global object property로는 사용할 수 없다.
- window.close() window.open() window.innerHeight window.innerWidth 등을 사용해서 window창 제어가능.
// 1. 단축키를 사용 handle close function 호출
function handleClose() {
store.dispatch({ type: CommonActionType.CLOSE_DIALOG });
setOpen(false);
closed(); // 2. 같은 component상에있는 closed()실행
}
function closed() {
window.closed(); // 3. 전역에 만들어놓은 window.closed() 라는 메서드를 연다.
}
// 4. 다른 component에 있는 전역객체 closed()를 호출해서 실행한다.
window.dialog_closed = (info) => {
//
//
}
'JavaScript' 카테고리의 다른 글
Window event (1) | 2022.10.07 |
---|---|
code refactoring 01 (0) | 2022.10.05 |
short circuit evaluation (0) | 2020.12.26 |
Spread Operator (0) | 2020.12.26 |
Type Conversion in Javascript (number, string) (0) | 2020.09.15 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- easy algorithm
- java
- code refactoring
- 프로그래머스 알고리즘
- algorithm
- math.abs
- C++
- compareTo()
- HackerRank Algorithm
- hackerrank solution
- javascript
- HashMap
- Javascript Algorithm
- rest parameter
- 프로그래머스 알고리즘문제
- 프로그래머스
- Object type casting
- string class in java
- repeat()
- 알고리즘
- hackerrank javascript
- hackerrank
- equals()
- spring boot application
- Collection Framework
- math.max
- hackerrank javascript solution
- ... in Javascript
- easy javascript algorithm
- substring()
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
글 보관함