This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman 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 Elasticsearch in Action this week in the Big Data 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: 62139
    
  68

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]
 
I agree. Here's the link: http://kickstarter.com/rocket-mass-heater
 
subject: How to show loading image while moving between pages?