This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 72
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: 61106
    
  66

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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to show loading image while moving between pages?