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开发者_StackOverflow社区 = "position:absolute;top:15px;left:300px";
W3CElement.appendChild(img);
}
it works fine in FF but iframe.onload
does not in IE.
Have you ever been tried some thing like this?
setTimeout(function() {
iframe.onload = function() {
//var height=iframe.contentWindow.document.body.scrollHeight;
alert('');
W3CElement.removeChild(img);
iframe.style.cssText = "width:100%;height:400px";
}
}, 0);
frame.attachEvent('onload', function() { CustomFunction()});
精彩评论