The Artima Developer Community
Sponsored Link

Java Buzz Forum
Refreshing a Frame with No Jump Back

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sam Dalton

Posts: 143
Nickname: samd
Registered: Jun, 2003

Sam Dalton is a Java Developer with ThoughtWorks in teh UK
Refreshing a Frame with No Jump Back Posted: Sep 17, 2003 4:13 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Sam Dalton.
Original Post: Refreshing a Frame with No Jump Back
Feed Title: import java.*;
Feed URL: http://www.samjdalton.com/pebble/rss.xml
Feed Description: Random, Infrequent Bloggings of a Techie
Latest Java Buzz Posts
Latest Java Buzz Posts by Sam Dalton
Latest Posts From import java.*;

Advertisement

Several times in the past I have come across the situtation where I want to constantly refresh an HTML page as the data on it is changing periodically. This is easy enough to do with JavaScript (using a timeout) or using the (non-standard) META REFRESH option.

With all but the smallest pages, this presents another problem. That is, that every time the page refreshes, it scrolls back to the very top of the page. This is obviously very undesirable with large pages of data, as the user will neve manage to stay at the item that they are interested in for very long before the page scrolls away.

In the past I have solved this problem using some very nasty JavaScripts (another frame refreshing, and updating our mainframe with JavaScript). This is all very well, but when you have complex tables of data this becomes unwieldy, resulting in a lot of code duplication between the JavaScript and the server side script that originally generated the page.

In an effort to steer clear of such nasty JavaScripts, I have found another way to achieve the same result.

This solution uses IFRAMES (a Microsoft only Floating Frame). Bassically, you create a container page with and IFRAME contained with in it. This IFRAME contains your constantly refreshing page. This page might look like the excerpt below:


	<body bgcolor="#EEEEEE" style="margin:0em" >
		<iframe src="myRefreshingPage.jsp" FRAMEBORDER="0" scrolling="no" width="100%" height="100%"/>
	</body>

Now when we scroll, our only our IFRAME refreshes, and our main page stays where it is, which is where ever the user has scrolled to!

It must be noted that this solution only works in IE (3+), but I think there is a similar Netscape/Mozilla alternative - ILAYERS?)

Read: Refreshing a Frame with No Jump Back

Topic: W3C XML Schema will disappear Previous Topic   Next Topic Topic: Java app to protect privacy by disabling camera phones

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use