먼저 a라는 홈페이지에 auto_size.html을 만듭니다.
====================== auto_size.html - a.com =========================
<html>
<head>
<title>Resizing Page</title>
<script type="text/javascript">
function onLoad() {
var params = window.location.search.substring( 1 ).split( '&' );
var height;
for( var i = 0, l = params.length; i < l; ++i ) {
var parts = params[i].split( '=' );
switch( parts[0] ) {
case 'height':
height = parseInt( parts[1] );
break;
}
}
if( typeof( height ) == 'number' ) {
window.top.updateIFrame( height );
}
}
window.onload = onLoad;
</script>
</head>
<body>
<p>Resizing IFrame...</p>
</body>
</html>
=======================================================
그리고 a라는 홈페이지에서 링크할 문서에는 아래와 같이 삽입합니다.
======================= a.html - a.com ===================
<script type="text/javascript">
function updateIFrame( height ) {
var iframe = document.getElementById( 'myiframe' );
iframe.setAttribute( 'height', height );
}
</script>
http://b.com/b.html" scrolling=no frameborder=0 width="600" height="600">
이제 b라는 도메인의 b.html에는 아래와 같이 삽입합니다.
================== b.html - b.com============================
<style>
#inneriframe { position : absolute; top : 0px; left : 0px; visibility: hidden; }
</style>
<script type="text/javascript">
function rsize() {
var iframe = document.getElementById( 'inneriframe' );
var wrapper = document.getElementById( 'wrapper' );
var height = Math.max( document.body.offsetHeight, document.body.scrollHeight );
iframe.src = 'http://a.com/auto_size.html?height='+height; }
</script>
<body onload=rsize(); >
<div id=wrapper>
내용
</div>
<iframe id="inneriframe" width="10" height="10"></iframe>
</body>
출처 : phpschool
script
bibaram2008.05.02 · 5분 읽기 · 조회 5,658
타도메인간의 iframe 자동조절
bibaram2008.05.02 · 5분 읽기 · 조회 5,658이어서 읽기
html↗
favicon.ico Status 404 해결방법
favicon.ico 파일이 있어서 경로를 직접 설정해주는 게 최선이지만favicon.ico가 없다면 아래와 같이 넣어준다. <html> <head> <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> </head…
2020.09.25·1분 읽기
php↗
Codeigniter api에서 어떤 곳에서 보낸 json
$aData = var_export(file_get_contents('php://input'),TRUE); $aArr = json_decode(str_replace("'", "", $aData), true); 버전에 따라 다를 수도 있음 $this->input->raw_input_stream 이렇게 해보면 됨
2020.09.11·1분 읽기
server↗
apache 이미지 로그 안쌓이게 하기
웹서버를 운영하다 보면 Apache log 가 엄청나게 많이 쌓인다. logrotate 가 실행되고 있다면 어느 정도 로그가 정리가 되겠지만 아니라면 로그가 쌓여서 서버가 엄청 느려지거나 서버가 다운될 수도 있다. ErrorLo…
2020.02.17·2분 읽기
댓글 0
아직 댓글이 없습니다.