Wrox Programmer Forums
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 30th, 2008, 12:08 AM
Registered User
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default self.close();

In using the following code:

<a href="" onclick="self.close()";>Close This window</a>

which is a very old standard in JavaScript, all of the sudden in IE 7.0, Windows Explorer opens after the IE window or tab has been closed.

Is there a work around to the issue? Or must we just suffer with an IE issue?


Keeping up with Web Development is a full time job
Old January 30th, 2008, 03:55 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

That is correct behaviour, and has always happened in IE, to cancel the default action of the link you need to return false from the handler:
<a href="" onclick="self.close();return false;";>Close This window</a>

Joe (Microsoft MVP - XML)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser close when screen saver close Rehanrana Pro VB 6 1 April 7th, 2008 03:09 AM
window.close() failing to...well...close! mheathcote Javascript How-To 2 October 31st, 2005 03:02 PM
Close without changes GVB BOOK: Excel 2003 VBA Programmer's Reference 1 July 19th, 2005 03:33 AM
Close a view? justanu Crystal Reports 0 March 22nd, 2004 05:54 AM
How do i close pop-up window?: window.close () Burton HTML Code Clinic 2 September 8th, 2003 05:40 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.