dynamic images issue in IE
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5651668/set-time-out-in-javascript">set time out in JavaScript</a>  </p>
</blockquote>



<p>i have method settimeout, images are laoding with dynamic action in IE and FF, but it is not going to next page. </p>

<pre><code>    static private class SafeSubmitBehaviour extends AbstractBehavior{
    public void onRendered( Component component ) {
      super.onRendered( component );      
      StringBuffer buffer = new StringBuffer(200);
      buffer.append("&lt;script type=\"text/javascript\" &gt;\n");
      buffer.append("if (document.getElementById(\"").append(component.getMarkupId()).append("\").submitted.value == \"false\") {\n");
      buffer.append("document.getElementById(\"").append(component.getMarkupId()).append("\").submitted.value = \"true\";\n");
      buffer.append("setTimeout('document.getElementById(\"").append(component.getMarkupId()).append("\").submit()', 100);\n}else{\n");
      buffer.append("document.getElementById(\"toHide\").style.display=\"none\";\n}]]&gt;*/&lt;/script&gt;");      
      component.getResponse().write(buffer);
    }  
  }
</code></pre>

<p>HTML:</p>

<pre><code>&lt;div id="toHide" class="pb-text-align-center"&gt;
        &lt;img style="display: inline" src="img/load.gif" /&gt;
            &lt;form wicket:id="safeForm" class="clearfix"&gt;
            &lt;input type="hidden" wicket:id="submitted" value="false" /&gt;
        &lt;/form&gt;
    &lt;/div&gt;
</code></pre>

<p>how can i solve this? My issue is image with animation is not working IE, but working fine with FF.</p>

<p>Java script funtion from html view source:</p>

<pre><code> if (document.getElementById("safeForm4d").submitted.value == "false") {
 document.getElementById("safeForm4d").submitted.value = "true";
 setTimeout(function(){'document.getElementById("safeForm4d").submit()'}, 100);
 }else{
 document.getElementById("toHide").style.display="none";
 }
</code></pre>
