Avatar

opening links in a new tab or windows? (General)

by Alfie ⌂, Vienna, Austria, Wednesday, September 08, 2010, 12:19 (4999 days ago) @ Micha

Hi Micha & Peter!

In most html-version, the target attribute is deprecated.

Well, just in 'Strict' variants. Still valid in 'Transitional'.

A workaround is to use a JavaScript, see e.g. http://accessify.com/features/tutorials/new-windows/.

IMHO no good idea. Even if JavaScript is active, PopUps may still be blocked. Inexperienced users may be trapped - or even are not allowed to change the browser's settings (in some restrictive companies...).

It might be better to change the version from 'Strict' to 'Transitional':

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

=>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

... and modify scripts to open in a new window. Instead of

<a href="foo">bar</a>

use

<a href="foo" target="_blank">bar</a>

There is no method to force a link to open in new tab - this is set by the user in his/her browser's preferences.

In any case, the best solution is to disclaim...

Agree. 'My browser belongs to me!'

--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)


Complete thread:

 RSS Feed of thread