Solved

Auto Refresh a WebPage

Posted on 2003-11-11
13
24,568 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
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…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

830 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