Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to show loading image while moving between pages?

 
Mohan Mehra
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic