WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Popup Window idea

for

Number of posts in this thread: 8 (In chronological order)

From: Christian Heilmann
Date: Sun, Jul 24 2005 1:29PM
Subject: Popup Window idea
No previous message | Next message →

http://www.wait-till-i.com/index.php?p=130

As some might know, I am currently writing a chapter for "Constructing
Accessible Web Sites" by Apress / Friends of Ed.

As an example, I am writing a script to allow for "accessible" pop-up
windows. I had an idea I hadn't seen yet before and wondered if I
should pursue with it.

Here's the deal:

* We cannot assume that the user agent allows for popup windows
* When we use HTML and the target attribute, we can open a window, but
cannot "style" it or close it with a link
* When we have JavaScript enabled and we have a window.opener, we can
assume that the window was opened and we can add window.close() links.

Therefore I considered using link relationships in conjunction with a
script to make the whole process failsafe:
<a href="popup.html" rel="popup">popup</a>

would be changed by the script to a link opening the new window and
get a message attached that it does so.
<a href="parent.html" rev="popuptrigger">back</a>

would get a close.window() attached and the text changed to "close window".

Any comments why that is a bad idea and what would be a better one?
Yes, I will point out that popups should be avoided.

--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/




From: Jan Eric Hellbusch
Date: Mon, Jul 25 2005 2:11AM
Subject: RE: Popup Window idea
← Previous message | Next message →

Hello,

> Any comments why that is a bad idea and what would be a better one?
> Yes, I will point out that popups should be avoided.

Here is another one for the language barrier (German article):

http://bf-w.de/knowhow/pop-up-fenster

At the end of the article there are three dornloads, which do basically the
same as what you are planning to do.

By dynamically adding target and title you get your XHTML strict validation
and your popup.

I don't really see, why popups should _never_ be used. There are plenty of
examples, where they make sense (e.g. help page). In general they should be
avoided.

Regs
Jan





From: Christian Heilmann
Date: Mon, Jul 25 2005 2:17AM
Subject: Re: Popup Window idea
← Previous message | Next message →

On 7/25/05, Jan Eric Hellbusch < = EMAIL ADDRESS REMOVED = > wrote:
> Hello,
>
> > Any comments why that is a bad idea and what would be a better one?
> > Yes, I will point out that popups should be avoided.
>
> Here is another one for the language barrier (German article):
>
> http://bf-w.de/knowhow/pop-up-fenster
>
> At the end of the article there are three dornloads, which do basically the
> same as what you are planning to do.
> By dynamically adding target and title you get your XHTML strict validation
> and your popup.

That is not exactly what I am planning to do. I plan to add the text
to the link text, as not all have title readout enabled. Furthermore I
try to avoid target.

> I don't really see, why popups should _never_ be used. There are plenty of
> examples, where they make sense (e.g. help page). In general they should be
> avoided.

The example will be a help page, however, I will also add a
popunder/XHR solution for that as another idea.


--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/




From: Austin, Darrel
Date: Mon, Jul 25 2005 8:57AM
Subject: RE: Popup Window idea
← Previous message | Next message →

> As an example, I am writing a script to allow for
> "accessible" pop-up windows. I had an idea I hadn't seen yet
> before and wondered if I should pursue with it.

Is that something we actually need? ;o)

> Here's the deal:
>
> * We cannot assume that the user agent allows for popup windows
> * When we use HTML and the target attribute, we can open a
> window, but cannot "style" it or close it with a link
> * When we have JavaScript enabled and we have a
> window.opener, we can assume that the window was opened and
> we can add window.close() links.

Furthermore, I'd add:

* We can not assume that the end-user wants pop-ups
* We can not assume that the end-user isn't in control of their own
tabs/windows
* while the target attribute works, it's not valid xhtml and that
may cause issues with certain sites. Additionally, many folks
believe that javascript is the proper technology for modifying
the windows, pop-ups being one of those places to use it.

> Therefore I considered using link relationships in
> conjunction with a script to make the whole process failsafe:
> <a href="popup.html" rel="popup">popup</a>

That an absolute necessity, as many folks prefer to open windows how they
see fit...either dragging links back and forth between windows, or clicking
links to open in new tabs, etc.

> would be changed by the script to a link opening the new
> window and get a message attached that it does so.
> <a href="parent.html" rev="popuptrigger">back</a>

At this point, I'd have to strongly suggest that if you have a need for a
'back' link in a pop-up, then you shouldn't be using a pop-up window to
begin with.

Also, this type of behavior will act oddly if one hadn't popped up the
specific window. Ie, if I open your window in a new tab, why would 'back'
then close my tab?

> Any comments why that is a bad idea and what would be a better one?
> Yes, I will point out that popups should be avoided.

I wouldn't bother with the whole 'back' issue. Instead, I'd focus more on
the presentation of the link itself. Emphasize that if you are going to
create a pop-up link, do the following:

- retain an actual HREF (for the reasons noted above)
- make the link clearly indicate that a pop-up window will appear
(via an icon or text)
- when possible, have the pop-up link icon/text be written/styled by
javascript. If the client doesn't have javascript, then they won't
be confused with the pop-up links.
- make the pop-up window artificially small (yet resizable) so that
it is clear that a new window was created.

If it's clearly a link to a pop-up window, then they will be more aware that
a new window is coming. At that point, they can usually fine the 'close
window' widget themselves.

-Darrel




From: Christian Heilmann
Date: Mon, Jul 25 2005 9:15AM
Subject: Re: Popup Window idea
← Previous message | Next message →

> > As an example, I am writing a script to allow for
> > "accessible" pop-up windows. I had an idea I hadn't seen yet
> > before and wondered if I should pursue with it.
> Is that something we actually need? ;o)

I don't. Clients might. And junior developers who need to deliver
things or lose their jobs.

> * We can not assume that the end-user wants pop-ups

That is why we are not talking about unsolicited popups, but those who
tell the user they are popups and will not popup when you right click
or drag them.
God, "POPUP" is such a Pavlov word.

> * while the target attribute works, it's not valid xhtml and that
> may cause issues with certain sites. Additionally, many folks
> believe that javascript is the proper technology for modifying
> the windows, pop-ups being one of those places to use it.

Yes, that is why I want to use rel and rev...

> > would be changed by the script to a link opening the new
> > window and get a message attached that it does so.
> > <a href="parent.html" rev="popuptrigger">back</a>
>
> At this point, I'd have to strongly suggest that if you have a need for a
> 'back' link in a pop-up, then you shouldn't be using a pop-up window to
> begin with.

Actually this back link works when the popup didn't popup and will be
replaced by a window.close() when it has popped up. I am aware that
there is no real need for a "close window" button, but many designers
and usability experts will disagree with me there.

> Also, this type of behavior will act oddly if one hadn't popped up the
> specific window. Ie, if I open your window in a new tab, why would 'back'
> then close my tab?

It wouldn't:

" * When we have JavaScript enabled and we have a window.opener, we can
assume that the window was opened and we can add window.close() links."

no window.opener, no window.close(); It will link back to the original
page though, but that's what you will always get when you open in a
new tab.

> > Any comments why that is a bad idea and what would be a better one?
> > Yes, I will point out that popups should be avoided.
>
> I wouldn't bother with the whole 'back' issue. Instead, I'd focus more on
> the presentation of the link itself. Emphasize that if you are going to
> create a pop-up link, do the following:
>
> - retain an actual HREF (for the reasons noted above)
> - make the link clearly indicate that a pop-up window will appear
> (via an icon or text)
> - when possible, have the pop-up link icon/text be written/styled by
> javascript. If the client doesn't have javascript, then they won't
> be confused with the pop-up links.
> - make the pop-up window artificially small (yet resizable) so that
> it is clear that a new window was created.
> If it's clearly a link to a pop-up window, then they will be more aware that
> a new window is coming. At that point, they can usually fine the 'close
> window' widget themselves.

This is all taken care of. The real feedback I was wondering about is
if it is a good idea to use rel and rev for popups or not. ;-)

--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/




From: Austin, Darrel
Date: Mon, Jul 25 2005 9:19AM
Subject: RE: Popup Window idea
← Previous message | Next message →

> Actually this back link works when the popup didn't popup and
> will be replaced by a window.close() when it has popped up. I
> am aware that there is no real need for a "close window"
> button, but many designers and usability experts will
> disagree with me there.

Really? The only reason *to* have a close window link that I can think of
would be to hint at the fact that the window they are looking at was a
pop-up window. But there seems better ways to indicate that, so, you're just
left repeating a basic function of the browser itself. Which seems odd.

Are there arguments to keep a close-window link?

Otherwise, it sounds like you're covering most of the bases with your
script. Nice!

-Darrel




From: Christian Heilmann
Date: Mon, Jul 25 2005 9:26AM
Subject: Re: Popup Window idea
← Previous message | Next message →

> > Actually this back link works when the popup didn't popup and
> > will be replaced by a window.close() when it has popped up. I
> > am aware that there is no real need for a "close window"
> > button, but many designers and usability experts will
> > disagree with me there.
>
> Really? The only reason *to* have a close window link that I can think of
> would be to hint at the fact that the window they are looking at was a
> pop-up window. But there seems better ways to indicate that, so, you're just
> left repeating a basic function of the browser itself. Which seems odd.
>
> Are there arguments to keep a close-window link?

I assume the worst: The classic popup window with some legal mumbo
jumbo to read and no navigation.

Scenario:
- User without JavaScript clicks the link
- Mumbo Jumbo page opens in main window
- User needs to use the browser back functionality to get back to the
previous page

With a back link there would be at least a bit of navigation to keep
the page up as an experience.

Yes, I know that this is bad practice (although very common) and that
users are very well aware of how to use their browsers. I could think
though that information terminal users or real "only one window
instance" browsers could be easier to use with a back link.




From: Andrew Kirkpatrick
Date: Mon, Jul 25 2005 11:29AM
Subject: RE: Popup Window idea
← Previous message | No next message


> This is all taken care of. The real feedback I was wondering about is
if it is a good idea to use rel and rev for popups or not. ;-)

The HTML recommendation provides a list of expected values
(http://www.w3.org/TR/html4/types.html#type-links) which doesn't include
popup. It does allow for the addition of new values if a profile is
specified. It doesn't seem that popup really describes the relationship
between the current document and the linked document (not that the items
in the expected values list do very well either...).

Can you use the class attribute for this same purpose? It is more
likely that the class attribute is being used, so you'd need to modify
it a little more carefully (e.g. <a href="foo.html class="foo"> would
become <a href="foo.html" class="foo popup">).

Hope this helps,
AWK

Andrew Kirkpatrick
Principal Accessibility Engineer, Macromedia
= EMAIL ADDRESS REMOVED =