Mario: Animated gif im IFrame während dem laden

Beitrag lesen

Hallo,

während meine php file im IFrame ladet, soll eine Grafik eingeblendet werden. Das geht leider nicht, obwohl es mit einem Text geht. Weiss jemand warum?

Danke!

---

<iframe id="iframe" src="generator.php" width="90%" height="400" name="" frameborder="no">
  <p>No IFrame possible</p>
</iframe>

<script type="text/javascript">
 // does not work
//document.getElementById('iframe').contentWindow.document.body.innerHTML = '<img src="ajax-loader.gif" align="top">';

// works
 document.getElementById('iframe').contentWindow.document.body.innerHTML = 'text';
</script>