faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 19 people (58%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How do I close a window that was loaded with an url pointing outside my domain?

Jul 30th, 2001 23:23
stuart jameson, Martin Honnen, Olivier LAHAYE,


It shouldn't matter where the file comes from that is loaded into the 
window. If your script opened the window with
  var win = open ('...')
it can close it with
  win.close();
If the window was not opened by JavaScript but you got an handle to it 
with
  var win = open ('', 'windowName');
you can attempt to close it with
  win.close()
but the browser will ask the user for confirmation.


I think there may be a bug with IE 4.x  in that if an insecure window 
(http) opens a secure page (https) if the child window attempts to 
access the parent a Dr Watson error occurs.  (This is half question 
does anyone know more about secure windows talking to normal windows?)