Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Auto Refresh a WebPage

Posted on 2003-11-11
13
Medium Priority
?
24,575 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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 
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 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

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…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

705 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