aspose file tools*
The moose likes JSP and the fly likes How to refresh a page without using AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to refresh a page without using AJAX" Watch "How to refresh a page without using AJAX" New topic
Author

How to refresh a page without using AJAX

Pavan BH
Greenhorn

Joined: Sep 21, 2008
Posts: 7
Hi,

How to refresh textbox without using AJAX.
Please help me in this topic.
for example when i select country the particular states should be displayed in dropdown.

Thanks you.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
If you don't want to access the server, then you'll need to keep all information on the client as part of the web page. You'll need JavaScript data structures that hold the lists of states for all countries of your menu.


Ping & DNS - updated with new look and Ping home screen widget
Pavan BH
Greenhorn

Joined: Sep 21, 2008
Posts: 7
As I know by using the javascript the whole page will be refreshed but not the particular textbox
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
I don't understand what you're trying to say. If all the pertinent data is part of the original page (in appropriate JavaScript data structures), then it doesn't need to be refreshed, neither whole nor in parts. You will need to write the JS code to change the states menu in response to a selection in the country menu, obviously.
Pavan BH
Greenhorn

Joined: Sep 21, 2008
Posts: 7
thank u
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15662
    
  15

I think our naming requirements (http://www.javaranch.com/name.jsp) require a real last name, not just initials, but thanks for trying.

A web page in a browser like Internet Explorer or Firefox is stored in a hierarchical structure (the Document, or DOM). You can alter that document and its corresponding graphical section of the user's display will change without changing the content of the rest of the page, although the layout may be adjusted.

However, to do that, you need client-side scripting, such as JavaScript. AJAX is JavaScript plus communication back to a server.

The only way you can refresh the page without client-side scripting is to put a timer on page refresh using the HTML metatags. But that refreshes the ENTIRE page, not just part of it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

"Pavan BH", My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gopikrishna Madishetti
Greenhorn

Joined: Sep 30, 2008
Posts: 10
You can do it by Javascript, it will not refresh the page. It will just load the data when you select a country.
Javascript is the best option.

Thanks.
 
 
subject: How to refresh a page without using AJAX
 
Similar Threads
Refreshing Tag Library using AJAX
Invalidate session from client side?
JSF 1.1 - Refresh of page
Struts2 Pagination
Ajax Application