[Javascript] Closing a popup window

Flavio Gomes flavio at economisa.com.br
Wed Nov 24 11:40:33 CST 2004


<script language="JavaScript">
     parent.opener.setTransfer('$sID','$sField');
     self.close();
</script>

self.close();
  or
window.close();

 will work if you run these in the 'child' (just opened) window.

 Hope it helps
--
Flavio Gomes
flavio at economisa.com.br

Javier wrote:

>Hello everybody:
>
>I've a formular, that calls to a popup window. When something is done
>in the popup window, then some data is sent to the formular.
>I use for example the following function, for transfering the 
>information to the formular:
>
><script language="JavaScript">
>     parent.opener.setTransfer('$sID','$sField');
>     self.close();
></script>
>
>
>The function setTransfer in the formular looks like:
>
>function setTransfer(PhototextID,field)
>{
>    document.frmRegister.elements[field].value=PhototextID + ".jpg";
>}
>
>I want to close the popup-window, when the 'setTransfer' function
>is called. I've try with: "parent.caller.close", but the parent
>object is null, any suggestions?
>
>
>
>Javier
>  
>



More information about the Javascript mailing list