File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Error: Permission Denied Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Error: Permission Denied" Watch "Error: Permission Denied" New topic

Error: Permission Denied

Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
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.

My problem is, when the new window is in minimized state this code performs well and the window gets closed with the alert mesg specified.
But when i forcefully open the minimised window i get a JavaScript error and the window does not close.

Line: 1
Char: 1
Error: Permission Denied
Code: 0

SCJP 1.5
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 445

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.

Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
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
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
Please any one help me out with this problem.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
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.

I agree. Here's the link:
subject: Error: Permission Denied
It's not a secret anymore!