Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 05:27 PM
Kai Grossjohann
Guest
 
Posts: n/a
Default Show popup that's easy to close?

I use <script type="text/javascript">window.open(...)</script> to open
a popup window with some informational messages. Currently, my way of
allowing the user to close this window is to put a form in it that has
a submit button which does javascript:close().

This way, users can type <Tab> <Return> to close that window.

Is there a way to get such a window so that people can even do
<Escape> or just <Return> to close the window?

tia,
Kai

  #2  
Old July 20th, 2005, 05:27 PM
Philipp Lenssen
Guest
 
Posts: n/a
Default Re: Show popup that's easy to close?

Kai Grossjohann wrote:
[color=blue]
> I use <script type="text/javascript">window.open(...)</script> to open
> a popup window with some informational messages. Currently, my way of
> allowing the user to close this window is to put a form in it that has
> a submit button which does javascript:close().
>
> This way, users can type <Tab> <Return> to close that window.
>
> Is there a way to get such a window so that people can even do
> <Escape> or just <Return> to close the window?
>[/color]

What about just Alt+F4?
Works without you doing anything.

BTW, often people will use this or similar short-cuts to close pop-up
windows so they won't even see your "informational messages".

--
Google Blogoscoped
http://blog.outer-court.com
  #3  
Old July 20th, 2005, 05:27 PM
Markus Ernst
Guest
 
Posts: n/a
Default Re: Show popup that's easy to close?

"Kai Grossjohann" <kai@emptydomain.de> schrieb im Newsbeitrag
news:87wuamhik4.fsf@emptyhost.emptydomain.de...[color=blue]
> I use <script type="text/javascript">window.open(...)</script> to open
> a popup window with some informational messages. Currently, my way of
> allowing the user to close this window is to put a form in it that has
> a submit button which does javascript:close().
>
> This way, users can type <Tab> <Return> to close that window.
>
> Is there a way to get such a window so that people can even do
> <Escape> or just <Return> to close the window?[/color]

Have you tried to give the button the focus on load? Then hitting return
will close it without the need of a tab hit.

<input type="button" value="Close Window" onClick="self.close()"
onLoad="this.focus()">

HTH (not tested)

Markus


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles