House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Fusebox

JavaScript: close window and refresh screen

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi,
Natasha Regehr
05/25/01 05:44 P
Maybe try:
Kevin Bridges
05/25/01 05:58 P
Natasha,
Nelson Winters
05/25/01 06:14 P
Thank you for the help, the problem is fixed!
Natasha Regehr
05/25/01 08:26 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Natasha Regehr
05/25/2001 05:44 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kevin Bridges
05/25/2001 05:58 PM

Maybe try: function LoadMe() {   opener.location.reload();   self.close(); } 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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Nelson Winters
05/25/2001 06:14 PM

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 > 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 ----- Excess quoted text cut - see Original Post for more ----- 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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Natasha Regehr
05/25/2001 08:26 PM

Thank you for the help, the problem is fixed! Thanks guys! Natasha ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm


<< Previous Thread Today's Threads Next Thread >>

Search fusebox

March 12, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31