The following shows you how to add a Close Window hyperlink by creating a code snippet that closes a browser window and then inserting the snippet into a page from the code snippets library.
To create a Close Window code snippet
- Copy the following text beginning with <a and ending with /a> by selecting it and then pressing CTRL+C.
<a href="javascript:window.close();">Close Window</a>
- On the Tools menu, click Page Options, and then click the Code Snippets tab.
- Click Add.
- In the Keyword
box, type closeWindow.
- In the Description
box, type Close Window script.
- In the Text
box, paste the text that you copied in step 1 by pressing CTRL+V.
- Click OK to close the Add Code Snippet dialog box, and then click OK again.
To insert a Close Window code snippet into a page
- In Page view, at the bottom of the document window, click Code
. - Place the insertion point where you want to insert the code snippet.
- Press CTRL+ENTER.
- Select Close Window script from the list and press ENTER.