7 Replies Latest reply on Aug 18, 2006 5:03 PM by KateG

    Refresh CFInclude File

    KateG
      Is there a way to auto refresh an include file within a page? The data in the include file will be updated throughout the day so they would like to have it auto refresh every 15 minutes so they are seeing the latest data. Thanks for any replies.
        • 1. Re: Refresh CFInclude File
          Stressed_Simon Level 1
          Can you give us some more information on what you need? Do you mean you want a section of the page to update every 15 minutes if they leave the page open? Or do you want the contents of the cfinclude to be updated?

          If you mean a) then you need to use JavaScript, it is pretty simple.

          If you mean b) then just get it from the database, or generate an html file every 15 minutes and include that!
          • 2. Re: Refresh CFInclude File
            labst
            Would it not be enough to have the web page automatically call iteslf every 15 minutes?

            For example, if your page was called from

            index.cfm?do=MyQuery

            You could have in the <head> section:
            <head>
            <meta http-equiv="Refresh" content="900; URL=index.cfm?do=MyQuery">
            </head>

            this would refresh the page every 900 seconds (15 minutes).
            • 3. Re: Refresh CFInclude File
              KateG Level 1
              Yes... I need only a section of the page to refresh every 15 minutes. The page is a sort of dashboard and the table at the top, which is now an incliude file, needs to refresh. The rest of the page has some show/hide divs on it so if someone was looking at something and the page refreshed as it is doing now, it resets back to the default view.
              • 4. Re: Refresh CFInclude File
                jdeline Level 1
                I would make a framesete with two horizontal, seamless frames. The top frame has the code suggested by labst - the meta refresh every 900 seconds. When it refreshes, it will probably query a database for the latest information. The bottom frame can just sit there, can be scrolled, linked to another page, etc.
                • 5. Re: Refresh CFInclude File
                  KateG Level 1
                  Okay... I have never used iFrames before but I added one to my page index.cfm:

                  <td valign="top" id="main>
                  <iframe name="iframe1" src="inc_hc.cfm" align="top" height="100" width="550" hspace="10" vspace="10" scrolling="no" frameborder="0" >
                  </iframe>
                  </td>

                  Works perfectly. See my whole table.

                  Then in the head section I have the refresh stuff.

                  <meta http-equiv="refresh" content="60, URL= URL=inc_hc.cfm">

                  When the refresh happens though it still refreshes the entire page. Must be missing something, right?

                  Thanks
                  • 6. Re: Refresh CFInclude File
                    Dan Bracuk Level 5
                    quote:

                    Originally posted by: KateG
                    Okay... I have never used iFrames before but I added one to my page index.cfm:
                    <td valign="top" id="main>
                    <iframe name="iframe1" src="inc_hc.cfm" align="top" height="100" width="550" hspace="10" vspace="10" scrolling="no" frameborder="0" >
                    </iframe>
                    </td>
                    Works perfectly. See my whole table.
                    Then in the head section I have the refresh stuff.
                    <meta http-equiv="refresh" content="60, URL= URL=inc_hc.cfm">
                    When the refresh happens though it still refreshes the entire page. Must be missing something, right?
                    Thanks

                    Is that meta tag in the inc_hc.cfm or the parent page?
                    • 7. Re: Refresh CFInclude File
                      KateG Level 1
                      That was it. I had it on the main page instead of the include. You people are the best! Thank you all for the replies.