|
Mailing Lists
|
Home /
Groups /
Fusebox
JavaScript: close window and refresh screen
Author: Natasha Regehr
Short Link: http://www.houseoffusion.com/groups/fusebox/thread.cfm/threadid:957#5043
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
Author: Nelson Winters
Short Link: http://www.houseoffusion.com/groups/fusebox/thread.cfm/threadid:957#5040
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
Author: Kevin Bridges
Short Link: http://www.houseoffusion.com/groups/fusebox/thread.cfm/threadid:957#5038
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: Natasha Regehr
Short Link: http://www.houseoffusion.com/groups/fusebox/thread.cfm/threadid:957#5037
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
|
May 25, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||