[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: onClick to close window?



To make sure the small window gets closed when you leave the page that
opened them, you can use the onUnload.  If you want to do it in the onClick
you should be able to do that too.  Basically what's important is that you
set up an object for each new window that you open. (This is discussed in
the JavaScript FAQ -- http://www.his.com/~smithers/freq/beta/)

var smallWindowObject = window.open('myUrl','myNewWin',<winOptions>)
smallWindowObject = window.open('myUrl','myNewWin')   //for mac and X bug

**In Link**
<A HREF="otherPage.html" TARGET="mainFrame"
  onClick=smallWindowObject.close()>

You may want to make a cleanUp() function that will close all open windows.

Andy 'Mohammed' Augustine
JavaScript 411 -- http://www.his.com/~smithers/freq/beta/index.html

At 08:21 PM 2/23/96 -0500, Peter Barvoets wrote:
>Hi,
>
>I am new to javascripting. I have a page I have been experimenting
>with that uses frames. The top frame contains form buttons that each
>open little windows with a list of links. each link is targeted to the
>bottom frame.
>
>The problem is the small window stays open after the link has been
>chosen. Can I use onClick to close the window after the link has been
>chosen? If so, does the script go in each html document that contains
>the links for each window?
>
>Please be graphic when you answer this, as I am a newbie to all this.
>
>Thanks,
>
>Pete B.
>--------------------------------------------------------------------
>This message came from the mailing list javascript. For help using the
>mailing list software, please send a message to 'majordomo@obscure.org'
>with the message body 'help'. To unsubscribe, send a message to
>'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
>
>

--------------------------------------------------------------------
This message came from the mailing list javascript. For help using the
mailing list software, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.