I have a jsp page called main.jsp.In this page I have a href link which calls another jsp page first.jsp. When I click this first.jsp, it takes some time to laod. while loading, how can I show a message "Loading, Please wait".
You can put a hidden div that's positioned wherever you want on the page, and reveal it just before the link is submitted via the onclick handler of the link. [ June 02, 2008: Message edited by: Bear Bibeault ]
What have you got so far? All you need to do is create a block containing your "Loading..." message with its CSS display property set to none. Then, in the onclick handler, set the property to block.
phani kon
Ranch Hand
Joined: Apr 06, 2005
Posts: 251
posted
0
here is the code for the main.jsp which calls <br> <a href="StartPage.jsp"><font size=3 face="Times" color="990033"> <center> <b> main apge </b></center></font></a> <br>
while loading StartPage.jsp page, I need to show the status of loading page
Umm, you do realize that the font tag is deprecated? Why are you using such old HTML? Are you not up-to-speed on CSS?
phani kon
Ranch Hand
Joined: Apr 06, 2005
Posts: 251
posted
0
Can you please help me in doing that? I don't understand, how to start also. I never use the DIV before. I want to show the laoding message when I click the startpage.jsp.
If you don't know how to write basic HTML, I'd suggest that you bone up on HTML before trying to dive off into more advances topics like event handling.
<div id="mydiv" class="test" ><h3>This is a test!<br>Can you see me?</h3></div>
</body> </html>
darshan karle
Greenhorn
Joined: May 09, 2008
Posts: 28
posted
0
hi lakshmi
sorry for one mistake.actually there are two lines starting with document.getElementById('mydiv'). in java script. please remove the first line which is incomplete
regards darshan
phani kon
Ranch Hand
Joined: Apr 06, 2005
Posts: 251
posted
0
Thanks for you help, I have modified the code below, with a href. Is that ok?
<div id="mydiv" class="test" ><h3>This is a test!<br>Can you see me?</h3></div> [ June 03, 2008: Message edited by: lakshmi manepally ]
Usman Saeed
Ranch Hand
Joined: May 21, 2008
Posts: 30
posted
0
Hi lakshmi, i made lots of tries to upload code regarding your problem but i am afraid its very user unfriendly way to add code in reply on this forum.
darshan here ,i javaranch i cannot paste the code as it is.to avoid virus they have done like that.
in the code i have pasted please....... make one change. before and after onclick there is left arrow between double quote.remove left arrow along with double quotes.it will work fine
good luck.
phani kon
Ranch Hand
Joined: Apr 06, 2005
Posts: 251
posted
0
I have already did that. Actually, my problem is when I click the submit button, it calls the jsp page.But it is loading the page for a long time. Is there any way I can make the page loading faster.
OR while loading the page I want to show some message on the status bar. The page is laoding please ..wait.
Speeding up the response is a server-side issue. Have you profiled the code to see where the bottle-necks may lie? [ June 04, 2008: Message edited by: Bear Bibeault ]
phani kon
Ranch Hand
Joined: Apr 06, 2005
Posts: 251
posted
0
Actually the page it is loading has some drop down values coming from the database.
Database access can be lightning fast or excruciatingly slow depending upon too many factors to count. In order to find out where the slowness is coming from, you need to measure where in the code the bottleneck is. Profiling tools are designed for just that,
lina ajay
Ranch Hand
Joined: Apr 04, 2008
Posts: 31
posted
0
Originally posted by lakshmi manepally: Actually the page it is loading has some drop down values coming from the database.
try this with the former code given by darshan. function A() {