where do you put script for close window

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

Guest

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?
 
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?
 
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.
 
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>
 

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