0
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);
}

it works fine in FF but iframe.onload does not in IE.

user160820
  • 14,866
  • 22
  • 67
  • 94
  • What version of IE? Related: http://stackoverflow.com/questions/4334520/load-event-for-iframe-not-fired-in-ie – Matt Ball Oct 04 '11 at 15:37

2 Answers2

1

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);
Tarcísio Júnior
  • 1,239
  • 7
  • 15
0

frame.attachEvent('onload', function() { CustomFunction()});

michaeljiz
  • 194
  • 1
  • 2
  • 10