Solved

Auto Refresh a WebPage

Posted on 2003-11-11
13
24,565 Views
Last Modified: 2013-12-24
When you click refresh in the browser it refreshes the page and returns the screen view where you last had it. Is there a way to code this action so that I can auto refresh the page and return the viewer back to where they were in the page?
0
Comment
Question by:rcmb
  • 8
  • 5
13 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722440
When you say "auto refresh" do you mean every so often, or when clicking a button? How do you want the page to be refreshed?
0
 
LVL 12

Author Comment

by:rcmb
ID: 9722475
I would like the page to refresh every so often like every 2 minutes.
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722490
Well, the easiset way would be to add this to the <head> section of your page:

<meta http-equiv="refresh" content="120 ;url=index.html">
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 12

Author Comment

by:rcmb
ID: 9722508
I have tried that code and it refreshes the page but it always return me to the top of the page. I want the page to refresh and return to where the viewer was last viewing the page (say 3/4 down the page).
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722512
But you should know that this won't trap where the page was - you would need some complicated scripting to figure out where the position of the scrollbar is at the precise moment before the refresh...
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722516
Sorry - we got overlapped there. Read the above... can you explain why you're trying to do this - perhaps there's another way.
0
 
LVL 12

Author Comment

by:rcmb
ID: 9722517
Is there a way to assign a dynamic bookmark and then use

<meta http-equiv="refresh" content="120 ;url=index.html#bookmark">

as the code?
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722531
We can certainly appending the bookmark notation - but you still have the problem of knowing whether the user was viewing that dynamically created bookmark or not...
0
 
LVL 12

Author Comment

by:rcmb
ID: 9722533
I have an ASP page that displays the status of equipment/operations onboard US Navy Submarines. The different watchsections on the ship provide input as things change. When the Officer of the Deck views the master page I want the page to refresh every 2 minutes to gather any changes that may have been submitted. The problem is the page is very long and it the Officer of the Deck is reading Weapons Status and the page refreshes then he has to scroll all the way back down the page.
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722959
Yes, that's going to be a problem.

There are other options then. One would be to use separate iframe's on the page, and have the content in the iframe refresh, as opposed to the parent page. Is that an option for you?
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 500 total points
ID: 9723099
For example:

<html>
<head>
</head>
<body>
<p>Equipment:<br />
<iframe height="200" width="600" src="equip.html" id="frame1" name="frame1" scrolling="no"></iframe></p>
<p>Operations:<br />
<iframe height="200" width="600" src="oper.html" id="frame2" name="frame2" scrolling="no"></iframe></p>
<p>Weapon Status:<br />
<iframe height="200" width="600" src="stat.html" id="frame3" name="frame3" scrolling="no"></iframe></p>
</html>

And each iframe page has <META http-equiv=refresh content=120> in the head section
0
 
LVL 12

Author Comment

by:rcmb
ID: 9723184
seanpowell,

I think you have a great idea there. Not only will that somewhat solve my problem but it will make management of the page much easier. I am going to build that page tomorrow and I will let you know how it worked.

RCMB
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9723248
Thanks - I was just thinkng about the page management issue given your description of what type of information you're processing. I thought that if you could deal with separate components that can easily be included/deleted from various screens it might be quite helpful.

Let me know if you need any work done on the front end, it's what I do for a living ;-)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question