Forums Register Login

How to put loading... when page is loading?

+Pie Number of slices to send: Send
if I have a JSP page that has a sql statment that pulls records from db. The db records is huge and when loading, the web page shows a blank page. How could I put an animated gif during the time when the data is loading ?
Thank you.
+Pie Number of slices to send: Send
You can try this ..
document.writeln('<HTML><TITLE></TITLE><BODY><DIV STYLE="position:absolute;left:10;font-Family:Sans-Serif;font-Size:18pt;visibility:show;"><CENTER><FONT COLOR="green"><B>Loading....</B></FONT></CENTER></DIV></BODY></HTML>');
Hope this helps you.
Regards
Dushyant Bhardwaj
+Pie Number of slices to send: Send
Thank you for your prompt reply. Do you mean this:
----
out.println(<HTML><TITLE></TITLE><BODY><DIV STYLE="position:absolute;left:10;font-Family:Sans-Serif;font-Size:18pt;visibility:show;"><CENTER><FONT COLOR="green"><B>Loading....</B></FONT></CENTER></DIV></BODY></HTML>');
SQL Statement ...
----
Thanks again.
+Pie Number of slices to send: Send
I tried the following, but still see the blank page.
+Pie Number of slices to send: Send
No , I meant to place this code in your JSP where you
are displaying your records back.
Regards
Dushyant Bhardwaj
+Pie Number of slices to send: Send
I've done something similar using the following trick:
Suppose you are on page A, and the user clicks a button which calls a JSP or Servlet to load the data from the database.
On page A, when the button is clicked, I set a <DIV> to appear and display an animated .gif which basically displays the usual animation you see when file processing is occurring.
Page A will remain visible until the request is processed by the server and returned to the client, so while the request is being processed, the user will see your .gif.
+Pie Number of slices to send: Send
You can also send the user to an intermediate page which shows some "loading "text and a "progress bar" and the page can refresh every X seconds and during the refresh looks for the data (perhaps in a session variable or something) then when a refresh occurs and the data is there, the user is forwarded to the actual data display.
For the "progress bar", you can display it in a table that looks like a progress bar and move the indicator right and left to show some movement.
I just did this myself in a Struts web-app I'm working on and it turned out very nice (IMO).
brian
I don't always make ads but when I do they're tiny
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1794 times.
Similar Threads
dynamically add rows to the exitsting table
simple web browser in java
problem in page load
help me ASAP
problem with duplicate records
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:16:49.