広範な調査の結果、これは機能するはずですが、IE8ではletsgo関数が呼び出されません...何か助けはありますか?
<script type="text/javascript">
function resizeCrossDomainIframe() {
if (window.addEventListener) {
window.addEventListener('message', letsgo, false);
} else if (window.attachEvent) {
window.attachEvent('onmessage', letsgo);
}
}
function letsgo(event) {
var iframe = document.getElementById('my_iframe');
if (event.origin !== 'http://mysite.com') return; // only accept messages from the specified domain
if (isNaN(event.data)) return; // only accept something which can be parsed as a number
var height = parseInt(event.data) + 32; // add some extra height to avoid scrollbar
iframe.height = height + "px";
}
</script>
<iframe src='http://mysite.com/products/default.aspx?iframe=true&partnerid=222&site=localhost:62014' frameborder="0" width="100%" scrolling="auto" style="min-height: 750px; min-width: 600px; background-color: #fff;" id="my_iframe" onload="resizeCrossDomainIframe();">
</iframe>