# 부모 페이지
<script>
try {
document.domain="test.co.kr";
}
catch(e) {}
function sendSize() {
var framemHeight = mainContentFrame.document.body.scrollHeight;
document.getElementById("frameArea").style.height=parseInt(framemHeight);
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<Tr>
<Td valign="top" align="center" id="frameArea">
<iframe name="mainContentFrame" src=http://test.co.kr/framepage.html" id="mainContentFrame" width="1024" height="100%" onload="sendSize()" scrolling="no" frameborder="0"></iframe>
</Td>
</Tr>
</table>
# 자식페이지
상단에
<script>document.domain="test.co.kr"; </scirpt>
※ 결과적으로 부모페이지와 자식페이지간 document.domain 값을 일치시키면 crossdomain 제약이 어느정도
풀리는듯~
출처 : http://mysource.tistory.com/80
'개발이슈 > FRONTEND' 카테고리의 다른 글
code: 'ERR_OSSL_EVP_UNSUPPORTED' 에러 해결방법 (0) | 2023.12.14 |
---|---|
[react.js] Node , webstorm 설치 및 기본 세팅 (0) | 2019.05.21 |
jquery 충돌 피하기 (0) | 2014.04.15 |
크로스 도메인 통신 (0) | 2014.02.10 |