• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Refresh CFInclude File

New Here ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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.
TOPICS
Advanced techniques

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2006 Aug 18, 2006

Copy link to clipboard

Copied

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation