Solved

Close a Window -- Permission Denied?

Posted on 2006-11-13
1
1,379 Views
Last Modified: 2012-08-13
My system uses popup windows to show data and stores their window handles in a array (openedWindows).  On timeout, I loop through the array to close all of these windows, but I have trouble closing a window that contains a PDF.

In this section of code:
      for ( var x = 0; x < openedWindows.length; x++ )
            openedWindows[x].close();
I get the error "Permission Denied" when reaching a window containing a PDF.  Other windows (like an About... box) close just fine.

I need to find a way to close all of the popups in the array, including PDFs.

~PerlChaser~
0
Comment
Question by:PerlChaser
1 Comment
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 125 total points
ID: 17930595
If the content comes from another domain or even port, then you will not be allowed.

You can put the pdf in a frameset and close the window then:

fset.html:

<frameset rows="100%,*" onLoad="top.contentFrame.location=unescape(location.search.substring(1))">
<frame name="contentFrame" src="blank.html">
</frameset>

link:
w=new Array();
function winOpen(url) {
  w[w.length]=window.open('fset.html?'+escape(url),.....)
}

Michel
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now