Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Close a Window -- Permission Denied?

Posted on 2006-11-13
1
Medium Priority
?
1,385 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 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…
Suggested Courses

972 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