• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Error: Permission Denied

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Cheers,
Raj.
 
Bharadwaj Adepu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please any one help me out with this problem.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Eric
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic