Xaisoft
Xaisoft

Reputation: 46591

Link in popup window does not close the window?

I have this bit of html code, but when I click the link, it does not close:

<html>
   <head>
   <title></title>
   </head>
<body>
    <h2>Members Only</h2>
    <p>You must be a member.</p>
    <p>Please Sign In or Create an Account.</p>
    <a href="javascript: self.close ()">Close this Window</a>
</body>
</html>

Upvotes: 0

Views: 436

Answers (2)

Canavar
Canavar

Reputation: 48088

I just removed the spaces and it works well :

<a href="javascript:self.close()">Close this Window</a>

Upvotes: 3

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114367

Popups suck, use a modal dialog instead, especially for something as simple as a notification.

That being said, try this:

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

Upvotes: 1

Related Questions