View Full Version : Open popup after Jsp page is loaded
manishramr
07-01-2009, 04:34 PM
Hello all,
I want to open a popup immediately after a JSP page is loaded.
Please note that i do not want it to be opened onLoad().
I want it to be opened after the jsp page is loaded.
Any pointers...?
Thank you in anticipation.
Manish...
servlet
07-02-2009, 03:49 PM
What do you mean by 'JSP page is loaded"? JSP has nothing to do with Java script popups.
How will you do it if you have a plain HTML file ? do it the same way with JSP.
ckeyrouz
07-02-2009, 06:19 PM
You cannot confuse the jsp execution (server side) with the javascript (client side) but I think I undertood your need:
The loading order in an HTML page is the following:
1- Script (not onload)
2- HTML body
3- Onload
What happens is that the jsp is compiled on the server side and the response is an HTML one to the browser.
So after that, the first thing to be executed is the javascript.
So if in your file you have the function showMyPopu() and you need to open the popup before your file load you can try doing the following:
<script language='javascript' type='text/javascript'>
showMyPopup();
function showMyPopup()
{
// your code for the popup is here
}
</script>
I do not know if this is what you need and if this really works, depending on what you are writing in the function. In the case I have written above you cannot call any html element because they are not loaded yet.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.