0
내용에 따라 iframe의 높이를 동적으로 변경하려고합니다.Chrome에서 iframe 문서 가져 오기
그러나 크롬의 최신 버전에서는 작동하지 않습니다.
doc는 크롬에 'undefined'
입니다.
Firefox에서 잘 작동합니다.
내가 뭘 잘못하고 있니?
<script>
$(function() {
$('#iframeid')
.load(
function() {
try {
var doc = this.contentDocument ? this.contentDocument
: this.contentWindow.document;
alert(doc);
} catch (e) {
alert(e.message);
}
});
});
</script>
<iframe frameborder="0" id="iframeid" src="iframesource2.html"
height="1px"> </iframe>