iframeタグを使わないでインライン表示

http://phpspot.org/blog/archives/2006/11/iframehtmlhtml.htmlに書いてあった方法。

<html>
<head>

....
<script language="JavaScript">
<!--
function isIE() {
    return navigator.userAgent.indexOf("MSIE") > -1 ? true : false;
}

function fake_iframe(html, w, h) {
  if (isIE()) {
        document.write('<object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="' + html + '" style="width:' + w + 'px;height:' + h + 'px">' +
        '<p>non object</p>' + '</object>');
    } else {
        document.write('<object type="text/html" data="' + html + '" style="width:' + w + 'px;height:' + h + 'px">' +
        '<p>non object</p>' + '</object>');
    }
}
// -->
</script>
</head>
<body>

....
<script language="JavaScript">
fake_iframe("foobar.html", 200, 200);
</script>
....

</body>
</html>

スクロールバーをどうするとかがないけど、使えるかも。知らなかった。

追記(11/26)

http://hyper-text.org/archives/2006/11/object_element.shtml によると、

<p>
 <object type="text/html" data="/foo/bar.html" width="100" height="100">
  object に対応していない場合はこれが表示される
 </object>
</p>

でいいみたい。