function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pDaisiespDaisies 

window.close(); Help?

Can someone tell me how to close a window that was generated with SCONTROL. I know how to call window.close(); but it appears to be overridden or something. I'd like to be able to create a pop up like the calender tool and close onClick with a button on the generated page. Help?
michaelforcemichaelforce
You've got the ticket with the "window.close()" function...  I use it in a button like so:
 
Code:
<input type='button' onclick="window.close();" value="Close Window">

 
This button would have to be located on the pop up, as you said... if you wanted to close the window from the parent window, that's possible as well.
mikefmikef
you might try

Code:
onclick="javascript&colon;window.close();" 

 


And please keep in mind that firefox only closes a window with the window.close method if the new window was open with a window.open method. I believe this is a security setting you can change but out of the box firefox is set up like that.


Message Edited by mikef on 01-18-2007 08:46 AM

pDaisiespDaisies
I'm actually using the embedded SCONTROL creation feature that says : open in a new window, when I genereate the SCONTROL for a lead view. So I don't know if they are using window.open(); or not. My guess is they are, but it doesn't seem to respond to window.close();

I'll try these things later. Thanks for the help.
AltiumForceAltiumForce
If you are using IE, try
window.opener = self;
window.close();

Firefox has a known issue with window.close();

mikefmikef
To my knowledge FireFox doesn't have an issue with window.close(), FireFox does have a security check that won't let window.close() close a window unless it was opened by some script.

The error you will get in the console is:
"Scripts may not close windows that were not opened by script."

I think IE has the security bug not the other way around.