Natasha,

Hopefully, this will get you started:

To open the new window, I use the following code:

function LaunchWindow(vAction) {
  remotewin = window.open('http://www.abc.com/index.cfm?fuseaction=' +
vAction, 'remotewin',
'width=245,height=190,resizable=0,scrollbars=0,top=200,left=200');
  if (remotewin != null) {
    if (remotewin.opener == null) {
      remotewin.opener = self;
    }
  }
}


After the user enters the data on the pop up and submits, you can use the
following code to refresh the main screen and close the pop up.  It will
also detect if the user closed the main browser.  If they did, it will open
a new browser with the location where they should be.


<html>
<head>
<SCRIPT>
window.onError = doError

function doError(a1,a2,a3) {
 window.open ('index.cfm?fuseaction=whatever');
 return true;
}

function RefreshOpener() {
 onerror = doError;
// you could use "opener.location.reload();" here instead of the next line
 opener.location.href = 'index.cfm?fuseaction=whatever';
}
</SCRIPT>
</head>
<body onload="RefreshOpener(); window.close();">

</body>
</html>


Nelson


----- Original Message -----
From: "Natasha Regehr" <[EMAIL PROTECTED]>
To: "Fusebox" <[EMAIL PROTECTED]>
Sent: Friday, May 25, 2001 5:43 PM
Subject: JavaScript: close window and refresh screen


> Hi,
>
> I have a question concerning JavaScript.
>
> I have a display file, and once the user selects an option from the drop
> down list box a smaller pop up screen appears. This pop up screen prompts
> the user to enter data. Once they have entered the data, they click
submit.
> This calls another fuseaction and enters the data into the database.
Within
> that same fuse I am also calling a file (see below) to close the pop up
> screen and refresh the main screen to display the current data. Here is
the
> code for the js I am using:
>
> <head>
>
> <script language="javascript">
> <!--
>  function LoadMe()
>  {
>   self.close();
>  }
> // -->
> </script>
> </head>
>
> <body onload="LoadMe()">
> <div align="center">
>
> <a href="javascript:window.close()"></a>
>
> </div>
> </body>
>
> The problem is that the pop up screen should close and the main should
> refresh automatically. Instead the pop up window will close, but the user
> must manually hit the refresh button on their browser in order for the
main
> screen to refresh.
> Any help is appreciated.
>
> Thank you,
> Natasha
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to