W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > April to June 2006

Re: SCR24: Using script to open a new window

From: Jim Ley <jim.ley@gmail.com>
Date: Mon, 22 May 2006 20:01:08 +0100
Message-ID: <851c8d310605221201p38530df8w959e84f7112379cc@mail.gmail.com>
To: w3c-wai-gl@w3.org

On 22/05/06, Christophe Strobbe <christophe.strobbe@esat.kuleuven.be> wrote:
> the same thing but that does not open a new window if a modifier key is
> pressed while the link is clicked. See
> http://www.456bereastreet.com/archive/200605/opening_new_windows_with_javascript_version_11/

Unfortunately this is not safe nor accessible - it violates the
changing of focus without user interaction problem.

more importantly, it assumes that if there is a window.open() function
which returns an object, then a new window was successfully opened,
this is completely unsafe and absolutely untrue, the script does not
work on all current main stream default configuration UA's let alone
rarer ones. (it depends on there not being certain 3rd party
anti-virus/anti-popup tools not being present in the mainstream ones)

> Another example is 'The Perfect Pop-up' at
> http://accessify.com/features/tutorials/the-perfect-popup/
>
> We could add these to the related resources for technique SCR24.

Again, this one is not perfect, it also does not work on numerous
UA's, it makes the unsafe assumption that window.open that doesn't
error results in a new window, it simply doesn't.

The example is:
<a href="file.htm" onclick="window.open('file.htm');return false;"
target="newWin">

A better example is:
<a href="file.htm" onclick="window.open('',this.target);" target="newWin">

but even this is not perfect, there's not much better.

This of course highlights the whole baseline problem, if you say the
baseline includes script, that doesn't really help when things like
window.open are implemented in so many different ways in so many
different situations, exactly what does a baseline of "javascript"
mean w.r.t. to the simple one thing of window.open.

Cheers,

Jim.
Received on Monday, 22 May 2006 19:01:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:47:46 GMT