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:

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by SallyAnneG
0

well give the whole code and we'll help u out..

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;)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.