2 Replies Latest reply on May 10, 2006 11:53 AM by flooker

    IFRAME Pause

    flooker Level 1
      hi guys , I tried looking in before posting but could find any thing . here is the problem .

      I have main page and in it i have iFrame . Code goes like this .

      function Dup(){
      DefAccountFrame.document.location = 'sliclist.cfm?sliclist='+GetSLIC+'&type='+me; // iframe call .

      now the problem is another_func_call(); is not waiting for the Iframe page processing to get completed and then invoke it self, what i am using right now is setTimeout("callme();",1000); inbetween but its not a good solution . what i want is another_func_call() to WAIT untill all the processing within Iframe is Done (which is populating some drop down menu based on Input) and then Another_func_call() will submit the page .

      any idea ?
        • 1. Re: IFRAME Pause
          boughtonp Level 1
          This is a JavaScript problem rather than a ColdFusion one, but anyhow... what you want is to keep checking the document.readyState property until it gets set to 4.

          More details available here: http://www.quirksmode.org/blog/archives/2005/09/xmlhttp_notes_r_2.html

          (That page is for XMLHTTP (aka AJAX), but it should work with an IFRAME too)
          • 2. Re: IFRAME Pause
            flooker Level 1
            Thanks peter for the link , Here is the detailed Code with Reccursive call to function to make sure IFRAME is loaded before doing any thing else on the page .

            <!--- Function to Handle on Enter Event of SLIC --->
            function Duplicate(GetSLIC){
            var me = 'SLIC';
            DefAccountFrame.document.location = 'sliclist.cfm?sliclist='+GetSLIC+'&type='+me;
            <!--- End Function --->

            <!---Mediator Function to handle recursive requests from callme(); to check the readystate and adding1 sec each call --->
            function dual(){

            <!--- Reccusrsive calling to a function if all the drop down menus are not populated it will wait untill Iframe is done processing--->
            function callme(me){
            if (me == 'complete'){
            ser(); // function needs to be called Finally which will submit the page .