function showHotelbewertung(W3CElement, objCode) {
var iframe = document.createElement("iframe"),
img = document.createElement("img");
W3CElement.style.position = "relative"
iframe.className = "bewertung_iframe"
iframe.id = "bewertung_iframe"
iframe.src = "http://example.com&code="+objCode;
W3CElement.appendChild(iframe);
iframe.onload = function() {
//var height=iframe.contentWindow.document.body.scrollHeight;
alert('')
W3CElement.removeChild(img);
iframe.style.cssText = "width:100%;height:400px";
}
img.src = "assets/images/loader.gif";
img.style.cssText = "position:absolute;top:15px;left:300px";
W3CElement.appendChild(img);
}
它在FF中工作正常,但iframe.onload
在IE中不起作用。
答案 0 :(得分:1)
你有没有尝试过这样的事情?
setTimeout(function() {
iframe.onload = function() {
//var height=iframe.contentWindow.document.body.scrollHeight;
alert('');
W3CElement.removeChild(img);
iframe.style.cssText = "width:100%;height:400px";
}
}, 0);
答案 1 :(得分:0)
frame.attachEvent('onload',function(){CustomFunction()});