This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to show loading image while moving between pages? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to show loading image while moving between pages?" Watch "How to show loading image while moving between pages?" New topic
Author

How to show loading image while moving between pages?

Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 70
i have a .jsp page and when i click on another .jsp page it takes time to load, so during that loading i want to display some image . how do i do that?
i tried this one :
http://www.netavatar.co.in/2011/05/31/how-to-show-a-loading-gif-image-while-a-page-loads-using-javascript-and-css/
but its not working
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

You can't. While the browser is in transition, it does't run any anything from any page including animations.

One way would be to submit the new request using Ajax so that script and animations can run on the "parent: page. When the request returns you can remove the animation or move to a new page,


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: How to show loading image while moving between pages?
 
Similar Threads
Loading Time
Showing image from a JAR on a JSP page
Progress bar
Can I use requestDispatcher.forward while using AJAX for Loading image
Loading message display in jsp