IE6 not permitting window.close() or window.focus() - any ideas

Reply

Join Date: Oct 2006
Posts: 4
Reputation: SallyAnneG is an unknown quantity at this point 
Solved Threads: 0
SallyAnneG SallyAnneG is offline Offline
Newbie Poster

IE6 not permitting window.close() or window.focus() - any ideas

 
0
  #1
Oct 25th, 2006
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:
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 1,311
Reputation: vishesh is on a distinguished road 
Solved Threads: 36
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: IE6 not permitting window.close() or window.focus() - any ideas

 
0
  #2
Oct 25th, 2006
well give the whole code and we'll help u out..
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 4
Reputation: SallyAnneG is an unknown quantity at this point 
Solved Threads: 0
SallyAnneG SallyAnneG is offline Offline
Newbie Poster

Re: IE6 not permitting window.close() or window.focus() - any ideas

 
0
  #3
Oct 25th, 2006
Originally Posted by vishesh View Post
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC