0 Replies Latest reply on Nov 14, 2007 3:42 PM by Randy Saborio

    oncomplete different behavior in Opera vs IE or FF

    Randy Saborio Newbie

      Hi,

      I have the following code:

      <t:div>
       <t:div id="myscript">
       <script type="text/javascript">
       function test() {
       alert("executed!");
       // content generated dynamically with a4j:repeat and other functions
       }
       alert("rendered!");
       </script>
       </t:div>
      
       ...
      
       <a4j:form ... reRender="myscript" oncomplete="test()">
       ...
       </a4j:form>
      </t:div>
      


      When the form is submitted, Opera first "reRenders" myscript div (allowing dynamic generation of JavaScript code) then execute it but IE and FF first execute the "old" test function (via oncomplete) then reRenders the new test function but no execution of the reRendered function.

      Why? Which one is the correct behavior? I think Opera behavior is correct but I need to solve this problem in all browsers.

      Thanks a lot!