spacer
Web Development Tutorials JAVA Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




Get Dynamic Web Content with HTTPRequest

By Doug Davis
2005-04-11


A refreshing approach to page refreshes

The HttpRequest object initially might not seem like a big deal. Explore the possibilities of it when you issue a HTTP GET or POST on a URL for succinct page refreshes that update only a specific portion of the Web page.

This article is for those of you who come across programming features that initially don't seem like such big deals, but in reality, open a vast array of possibilities. I came across such a feature not long ago. Now that I've used it quite a bit, I want to share the little gem with the rest of you. First, a little background: Many times I have put together a Web application and found the traditional way of updating the Web page quite limiting. Typically solutions include:

• Make the user click F5 to refresh the data
• Embed some meta-data that automatically refreshes the page after some timeout
• Use JavaScript and reload the page after some timeout
• Wait for the user to explicitly click a button or link that does a GET or POST

The main gripe I have with all of these solutions is that the level of granularity of the "get new data" is at the page level. By that I mean each one reloads the entire page -- causing flickering and, in some cases, losing my current scroll position. At times as I read a long document and the refresh occurs, the whole page scrolls and takes me back to the top (yes, I'm going to repeat this a lot because it really bugs me). The other complaint I have is that since each works on the page level I lose any updates I might have made on the page. For example, with any of the above auto-refresh options, when I enter data and click a Submit button, I lose any updates I made to text entry fields prior to clicking Submit.

You might wonder why I don't want to refresh the entire page. Suppose I have a Web page that acts like a portal for a management system. Perhaps, one section of the page displays log entries as they are generated and another section displays the current load on the system. And in a third section is an area where I am examining other data (large amounts of data) which requires that I scroll a lot. If the screen refreshes every minute or so -- it flickers and loses any temporary information -- like entry fields and scrolling positions of sub-elements -- each time.

Tutorial Pages:
» A refreshing approach to page refreshes
» Are applets healthy?
» Along came the HttpRequest object
» In Conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark Print |   Write For Us
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: