where do you put script for close window

L

Larryf666

I have pictures opening with an image from my website, where would I put the
code snippet for close window. I have tried to insert it into the line that
shows open new window & image name to no avail. Can someone help?
 
T

Tom Pepper Willett

You put it in the actual page of the new window that's opened.
--
===
Tom "Pepper" Willett
Microsoft MVP - FrontPage
---
About FrontPage 2003:
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
FrontPage 2003 Product Information:
http://www.microsoft.com/office/frontpage/prodinfo/default.mspx
Understanding FrontPage:
http://msdn.microsoft.com/office/understanding/frontpage/
FrontPage 2002 Server Extensions Support Center:
http://support.microsoft.com/default.aspx?scid=fh;en-us;fp10se
===
|I have pictures opening with an image from my website, where would I put
the
| code snippet for close window. I have tried to insert it into the line
that
| shows open new window & image name to no avail. Can someone help?
 
S

sheetrum

What I have done , and it works fine, was to create a hyperlink. Type the
words "Close Window" or create a button, etc.... your choice. Right-click,
choose Hyperlink... and copy and paste the line below for the link.

JavaScript:window.close();

If you want to print the page, just switch the word "close" for the word
"print". I just learned that last night! It did take a bit of searching
to find it, though.
 
M

Murray

The close works fine. The print will fail in IE5/Mac, however. To support
that browser, as well as the others, this is about as good as you can get -

Put this in the head of the document -

<script type="text/javascript">
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}
</script>

Put this in the body of the document -

<a href="javascript:print_page()">Print this</a>
 
Top