How do you show a loading image while your page is loading?
Could you guys point me in the right direction? Ive got a rails application that utilizes some jquery and javascript. It is taking awhile to load the page. Most likely because I make several SQL queries with embedded ruby code in my javascript.
Right now when users click on a link to go to that particular site, nothing happens for a few seconds and then the whole page loads.
You can do a loading page by having an overlapping default div with a loading animation in it in front of everything. Then when your Javascript is finished, have a callback that will hide the loading div.
However, I would say that 90% of the time when you need a page loading animation, you should think of ways to lazy load (load at a later time) as much of the processing as possible. Try to avoid page delays at all costs.