title: onload event on iframe working differently in ie and firefox/googlechrome
body: <p>here is my aspx page for iframe</p>
  
  <pre><code> &lt;asp:UpdatePanel ID="dynamicForm" runat="server" UpdateMode="Conditional"&gt;
              &lt;ContentTemplate&gt;                    
                  &lt;iframe id="iTargetLoader" name="iTargetLoader" width="200" height="50" onload="onLoadFn()"&gt;&lt;/iframe&gt; 
              &lt;/ContentTemplate&gt;
     &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>here is my onloadfn function in javascript for the onload event of iframe</p>
  
  <pre><code>function onLoadFn() {
          //debugger;        
          document.getElementById("iTargetLoader").contentWindow.document.defaultView.frameElement.innerText;
          var frame = document.getElementById("iTargetLoader");
          var contentDoc = (frame.contentWindow || frame.contentDocument);        
          if (contentDoc != null &amp;&amp; contentDoc.document.body != null) {            
              var serverResult = contentDoc.document.body.innerText;            
              var regSuccess = /success/i;
              if (regSuccess.test(serverResult)) {                
                  if (parseInt($('#ContentPlaceHolder1_hdn_qstnadd').val()) == 1) {                    
                          addQuestion();                                   
                      $('#ContentPlaceHolder1_hdn_qstnadd').val(0);
                  }                                  
                  //alert('success!');
                  //return "success!";
              }
              else {
                  if ($.trim(serverResult) == "") {
                      //alert("empty!");
                  }
                  else {
                      alert("failed!" + serverResult + "Please Contact Your Administrator!");
                      window.parent.window.open("", "_self");
                      window.parent.window.close();
                  }
                  //return "failure!";
              }
          }
          else {
              return "";
          }
      }
  </code></pre>
  
  <p>Here a feedback from a servlet is loaded to the iframe ie "iTargetLoader" i am trying to check the content of the iframe after it is loaded whether it is success or not.It is working fine in IE but when I use firefox or google chrome in the onload event the loading of the iframe does not complete and hence the inner html is shown null. But in IE the loading completes first and the innerhtml shows the feedback. How can I fix it? </p>