Solved

Auto Refresh a WebPage

Posted on 2003-11-11
13
24,570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTTPS upload and download website building help 4 52
Problem to get function 52 121
Column Spacing 3 143
The Best Website Creation Tools 14 122
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
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 Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

734 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