0 Replies Latest reply on Nov 24, 2007 1:09 PM by rhinox

    oncomplete different behavior in Opera vs IE and FF

    rhinox

      Hi,

      I have the following code:
      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!