July 05, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
Fusebox
JavaScript: close window and refresh screen
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
Author: Natasha Regehr
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
Author: Kevin Bridges
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
Author: Nelson Winters
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 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
Author: Natasha Regehr
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
|
Mailing Lists
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||