| | |
IE6 not permitting window.close() or window.focus() - any ideas
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 4
Reputation:
Solved Threads: 0
Hi
Have been battling for hours with a simple function asking a window that was opened with window.open() to be closed. Works fine in Firefox but IE just keeps creating an error "Permission Denied".
I doubted my code as a consequence, but have used sample code to check this and though the sample works over the net on the providers site, locally I still get "Permision Denied". Any ideas would be great.
Sal:rolleyes:
Have been battling for hours with a simple function asking a window that was opened with window.open() to be closed. Works fine in Firefox but IE just keeps creating an error "Permission Denied".
I doubted my code as a consequence, but have used sample code to check this and though the sample works over the net on the providers site, locally I still get "Permision Denied". Any ideas would be great.
Sal:rolleyes:
•
•
Join Date: Oct 2006
Posts: 4
Reputation:
Solved Threads: 0
The following is the line of code that prompts the window to open on the click of some text (In this case, either "User's Terms and Conditions" or "Privacy Policy"
<div class="rodsCentred"><div class="rodBackground"><a id="T&C" onclick="F_OpenPDFWindow('../pdfs/legal/UsersTermsAndConditions_V1_Jan2004.pdf')">User's Terms and Conditions</a></div><div class="rodBackground"><a id="PPolicy" onclick="F_OpenPDFWindow('../pdfs/legal/PrivacyPolicy_V1_Jan2004.pdf')">Privacy Policy</a></div>
As I was having trouble in IE with window.focus(), I decided to close the window (opened with window.open()) before re-opening if the alternative text was clicked. That is is someone first looked at the Terms and Conditions and then decided to look at the Privacy Policy, if that makes sense. Thus the function is as follows:
function F_OpenPDFWindow(NewWin)
{
if(PDF_PopUp!=undefined)
{
PDF_PopUp.close();
}
var PageContent=NewWin;
PDF_PopUp = window.open(PageContent, "pdfWindow","width=750,left=30,top=40,scrollbars");
}
This code works fine in Firefox, but as mentioned before, IE just throws and error stating "Permission denied". Have almost decided that I am going to have to completely re-think how I present this data!! Very frustrating so ... thanks for your help!
Sal
<div class="rodsCentred"><div class="rodBackground"><a id="T&C" onclick="F_OpenPDFWindow('../pdfs/legal/UsersTermsAndConditions_V1_Jan2004.pdf')">User's Terms and Conditions</a></div><div class="rodBackground"><a id="PPolicy" onclick="F_OpenPDFWindow('../pdfs/legal/PrivacyPolicy_V1_Jan2004.pdf')">Privacy Policy</a></div>
As I was having trouble in IE with window.focus(), I decided to close the window (opened with window.open()) before re-opening if the alternative text was clicked. That is is someone first looked at the Terms and Conditions and then decided to look at the Privacy Policy, if that makes sense. Thus the function is as follows:
function F_OpenPDFWindow(NewWin)
{
if(PDF_PopUp!=undefined)
{
PDF_PopUp.close();
}
var PageContent=NewWin;
PDF_PopUp = window.open(PageContent, "pdfWindow","width=750,left=30,top=40,scrollbars");
}
This code works fine in Firefox, but as mentioned before, IE just throws and error stating "Permission denied". Have almost decided that I am going to have to completely re-think how I present this data!! Very frustrating so ... thanks for your help!
Sal
![]() |
Similar Threads
- "Open new window" Window Size - how to change? (Web Browsers)
- Problem closing Browser with Window.Close (ASP.NET)
- window.close() not working in flash MX??? (Graphics and Multimedia)
- Drawing bitmap on window - how to clear window/HDC? (C)
- How to make a window an active window(focussed window) (C++)
- window loses focus on CR (Web Browsers)
Other Threads in the HTML and CSS Forum
- Previous Thread: Link html in a folder???
- Next Thread: Could you help me with this please?
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






