Forum Moderators: open

Message Too Old, No Replies

Opening and closing new window.

Can I close it?

         

D_Blackwell

3:32 am on Aug 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a link that must open in new window, and am doing this with target="_blank".

When the user completes a form, they are directed to a new page. My first choice is to have a "Close Window" button on that page. Can I reasonably accomplish this? My second choice is to ask the user to close the window now that they are done with it. This amounts to the same thing I suppose, but I'd really rather have the button.

If I open the window with Javascript, does this give me better options for closing it?

I need to make the opening and closing of this window a part of the natural flow of using the site, and avoid bumping up against difficulties. The user will want to use this window, but the implementation for exiting the window is clunky.

bibby

4:15 am on Aug 14, 2005 (gmt 0)

10+ Year Member



<a href="javascript:window.close();">Close This Window</a>

///////////

Be aware that some people block Javascript.
I'm at least warned when Javascript trys to close my window, and asks for approval.
Some people also have blockers for pages opening new windows to begin with. You may want to think of an alternative approach.

tedster

6:17 am on Aug 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you use javascript to OPEN the window, then javascript can close that same window without triggering any extra warning or request for user permission.