473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Accessing the window object - problems with Internet Explorer

2
I wonder if anyone has had problems with the above recently and has managed to solve them.

I have opened a new window using window.open which performs as would be expected in both IE and Firefox, but when I then want to close the window using window.close, IE just throws an error message "Permission denied".

On further investigation I found that IE threw out this message with window.focus() and window.name even though this did not cause a problem in Firefox.

Any ideas would be very gratefully received.

Function is shown below for further information (NewWin being the url of the .pdf I wish to open):
Expand|Select|Wrap|Line Numbers
  1. function F_OpenPDFWindow(NewWin)
  2. {
  3.     if(PDF_PopUp!=undefined)
  4.     {
  5.         PDF_PopUp.close();
  6.     }
  7.     var PageContent=NewWin;
  8.     PDF_PopUp = window.open(PageContent, "pdfWindow","width=750,left=30,top=40,scrollbars");
  9. }
  10.  
Oct 30 '06 #1
2 2737
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. function closewin() {
  2. window.open('','_parent','');
  3. win = top;
  4. win.opener = top;
  5. window.close();
  6. }
  7.  
use this code in the popup window itself then call the function when you want it to close. This code will close the window without confirmation.
Oct 30 '06 #2
Sal
2
Expand|Select|Wrap|Line Numbers
  1. function closewin() {
  2. window.open('','_parent','');
  3. win = top;
  4. win.opener = top;
  5. window.close();
  6. }
  7.  
use this code in the popup window itself then call the function when you want it to close. This code will close the window without confirmation.

Thanks for this, I will give it a try and report back.

Sal
Oct 31 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Michael | last post by:
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following: <a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a> The problem...
13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
5
by: Helen | last post by:
Hi, I am trying to write an ASP.Net application that integrates with a third party application via their fairly simplistic web component, however I am having problems with the URI. The URI...
3
by: Martin | last post by:
Hi I am attempting to write a small application that will allow users to manage the AddressBar entries within Internet Explorer. The typed URLs in the AddressBar can be found at...
7
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
3
by: Daniel Liberman | last post by:
Hi, everyone. That's my environment: - I have a pocket pc (iPAQ h4350) application developed with VSNET2003/C# that has a SQL Server CE Database, running. That's working fine. Obs: the pocket...
21
by: alistair_henderson | last post by:
Morning All, I have some code for a website which uses 'window.open' to simulate modal dialog boxes. I use the window.closed property to decide if the window object exists at various points. ...
8
by: mumpi | last post by:
From a documentlist the user activates links to see the document in a popup. The link (JSP): <a href='javascript:var w=windowOpenDok("${docURLPDFFromTiff}","document",0.5,0.8);w.focus();'> ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.