HOW DO I PUT A CLOSE WINDOW LINK ON A WEB PAGE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use Front Page Office XP. How do I put a link on a web page to close the
page. Thanks
 
<a href="javascript:window.close()">Close Window</a>

You can put anything you like instead of "Close Window."

Wally S
 
With text:

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

With a button:

<form>
<input type=button value="Close This Window" onClick="javascript:window.close();">
</form>
 
If the window has not been opened by another window using the JavaScript
window.open() method, you need to set the "opener" property of the window
prior to calling "window.close()" or the user will be prompted. Example:

<a href="window.opener=self;window.close()">Close Window</a>

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
It works okay for me, and I do not use a Javascript window opener. When I
set up the window in question, I simply use the "new window" option in the
hyperlinks dialog box.

Wally S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top