Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scrolling height of IFrame
Message
De
21/11/2012 03:26:20
 
 
À
20/11/2012 23:12:34
Information générale
Forum:
Javascript
Catégorie:
IFrame
Divers
Thread ID:
01557719
Message ID:
01557726
Vues:
28
>This code is good. However, I was executing it based on the existence of the loading of the frame where IE makes the object available when completed where Firefox and Chrome make the object available as soon as it is processed. Thus, the code was executing too fast for those two browsers. I have adjusted the code to plug the function to execute in the IFrame object onload event.
>
>So, this results in the same situation as before. In the function, I have an alert box. That alert box is shown before the frame becomes visible. This shouldn't be. Because the IFrame onload event should only occur when the frame has completed its loading process.
>
>
>      loIFrame=document.getElementById('IFrameMenu')
>      loIFrame.onload=ResizeEnvironment(nBrowserWidth)
>
Does this help: http://stackoverflow.com/questions/4548984/detect-if-the-iframe-content-has-loaded-successfully
 <script type="javascript"> var iframe = document.createElement("iframe"); iframe.src = "http:/ <script type="javascript">
var iframe = document.createElement("iframe");
iframe.src = "http://www.your_iframe.com/";
if (navigator.userAgent.indexOf("MSIE") > -1 && !window.opera) {
  iframe.onreadystatechange = function(){
    if (iframe.readyState == "complete"){
      alert("Iframe is now loaded.");
    }
  };
} else {
  iframe.onload = function(){
    alert("Iframe is now loaded.");
  };
}
</script>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform