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

Automatically Refresh Pages

New Here ,
Apr 16, 2007 Apr 16, 2007

Copy link to clipboard

Copied

Hi,

I need to write a small app. that gets the data from the DB then displays first 10 records, then the page automatically refreshes displaying the next 10 records and so on.

How can i do it. I just need the concept.

Thanks
TOPICS
Advanced techniques

Views

294

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

correct answers 1 Correct answer

Advocate , Apr 16, 2007 Apr 16, 2007
One way to approach it (and this may very well not be the best...or even an ideal way to do it), is to dynamically generate a META tag in your head section for refresh.

Something like:
<cfparam name="URL.startRow" type="numeric" default="1"/>
<cfif URL.startRow GT 1>
<cfset startRow = startRow + 10/>
</cfif>
<cfoutput>
<meta http-equiv="refresh" content="10; url=http://www.yoururl.com/yourpage.cfm?startRow=#startRow#" />
</cfoutput>
<cfquery.../>
...content output

Again, this is probably not...

Votes

Translate

Translate
LEGEND ,
Apr 16, 2007 Apr 16, 2007

Copy link to clipboard

Copied

How can i do it. I just need the concept.

Several ways, but one of the oldest and simplest ways would be a
'meta-refresh' tag that reloaded the page every x seconds, passing a url
value of what the next record set should be.

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
Advocate ,
Apr 16, 2007 Apr 16, 2007

Copy link to clipboard

Copied

One way to approach it (and this may very well not be the best...or even an ideal way to do it), is to dynamically generate a META tag in your head section for refresh.

Something like:
<cfparam name="URL.startRow" type="numeric" default="1"/>
<cfif URL.startRow GT 1>
<cfset startRow = startRow + 10/>
</cfif>
<cfoutput>
<meta http-equiv="refresh" content="10; url=http://www.yoururl.com/yourpage.cfm?startRow=#startRow#" />
</cfoutput>
<cfquery.../>
...content output

Again, this is probably not ideal but might get you going in the direction you wish.

Hope it helps.

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
Advocate ,
Apr 16, 2007 Apr 16, 2007

Copy link to clipboard

Copied

LATEST
Sorry, the cfset tag should be:
<cfset URL.startRow = URL.startRow + 10/>

was typing fast and forgot to scope it!

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