Please help me am facing a problem with a Java Script error.
I have a JSP page which takes input and validates the data with the database values and gives a report that opens in a new window.
The window has to be open for 30000ms(Milli Sec) then it should give an alert mesg and then it should close. When the submit button is pressed a new window is opened and report gets generated and displayed in this new window, As soon as this new window pops up, the focus will be jumping to main JSP and this new window gets minimized.
This is the code that closes the window after 30000 seconds.
I think moving the above code inside the page that displays the reports would be worth an effort. And set the code to be called on the onLoad() event of the new window that opens. You wont need the reference and calling window.close() from inside the new page would suffice.
Joined: Dec 30, 2007
Am opening the report window within the parent window, and what actually happens is the same main JSP will get loaded in the new window. I.e. if main jsp is main.jsp then from main jsp am calling
This URL contains few flags based on which its decided that contents shud be displayed or not. and then in the same main.jsp ill call
Personally I would never use a pop up window in applications with pop up blockers. Too much of a hassle makeing sure pop up ads are not blocked for an application.
A better solution is to add a hidden iframe to the page and set the iframe src with the information.
Now a solution for the pop up issue could be move the window.close line to the pop up and not in the parent. add a window.onload event to the child window and close it. No need for timers. The pop up will close when it renders.