Solved

Close a Window -- Permission Denied?

Posted on 2006-11-13
1
1,381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

738 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