Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- java 멀티스레딩
- 개발블로그
- WebMvcConfigurer
- 테스트대역
- 테스트더블
- MajorGC
- WebMvcConfigurationSupport
- refelction API
- 유스콘
- 자바디자인패턴
- mustache함수
- 클린아키텍처
- GOF
- 헥사고날
- js숫자체크
- Java
- reflection api
- java병렬처리
- 개발컨퍼런스
- 멀티코어 프로그래밍
- 동시요청
- @advice
- 인텔리제이에서 프로젝트 이름 바꾸기
- 어댑터패턴
- MinorGC
- 스프링부트 프로젝트 이름 변경
- test double
- Spring
- spring boot
- MappingJackson2HttpMessageConverter
Archives
- Today
- Total
목록window.postmessage (1)
져니의 개발 정원 가꾸기
(JavaScript) window.open()로 도메인이 다른 창을 열었을 때 발생하는 CORS 문제 - postMessage를 사용하자.
목차 배경 현재 개발/운영하고 있는 프로젝트에서 특정 버튼을 클릭하면 다른 도메인 서비스의 팝업을 여는 부분이 있었다. 팝업 사용 후 바로 직전의 부모창으로 다시 데이터를 넘겨줄 때 window.opener라는 객체에 접근하여 부모창의 주소 데이터를 참고하도록 되어 있었는데, 이 때 팝업창에서 부모창의 데이터를 가져오지 못해 opener의 데이터들이 undefined혹은 빈 string 으로 되어 값을 넘겨주지 못하는 상황이 발생했다. 원인은 부모창과 팝업창이 다른 도메인 주소를 가지고 있어 window.open()을 하였을 때 CORS문제로 값을 넘겨주지 못했던 것이었다. 해당 CORS 문제는 경고나 익셉션이 뜨지 않고 실제 데이터를 사용할 때 팝업창에서 undefined exception이 났을뿐더러..
개발노트/JavaScript | Mustache
2024. 3. 17. 23:56