opening a new window only absolute links

S

steve

Hi

I know that opening a new window (target="_blank") is a bed idea but I
have explain that to the client and he still want the links that are
link to other domain names to open in new windows.

I know that I can use <base target="main"> but that open all the links
in new window.

So how can I open in new windows only the links that are link to
external sites ( absolute links ) or only the links that are in one
table.

Thanks
 
D

David Dorward

steve said:
I know that opening a new window (target="_blank") is a bed idea but I
have explain that to the client and he still want the links that are
link to other domain names to open in new windows.

So be more persuasive?
I know that I can use <base target="main"> but that open all the links
in new window.

So how can I open in new windows only the links that are link to
external sites

JavaScript. Loop through every anchor onload and dynamically set the target
based on the value of the href attribute (if one exists).
 
D

Dave Patton

steve said:
Hi

I know that opening a new window (target="_blank") is a bed idea but I
have explain that to the client and he still want the links that are
link to other domain names to open in new windows.

Have you explained that not only is it bad for usability reasons,
but that no matter what method you use to 'force' this on users
that if the user wants, they can disable it?
Yes, not every user would know how, or have a browser that supports
such control, but maybe once the client knows that what they want
won't do what they want(some of the time), they will listen to reason.

Some sites use a small visiual indicator next to offsite links,
presumably because they are willing to believe that users are
smart enough to decide for themselves if they want to open
'offsite links' in a new window(or, with better browsers,
a new tab).
 
S

steve

Some sites use a small visiual indicator next to offsite links,
presumably because they are willing to believe that users are
smart enough to decide for themselves if they want to open
'offsite links' in a new window(or, with better browsers,
a new tab).

Yes I really did not think of that
Thanks

How can I achieve something like that

for example

link55 open link55 in new window
 
T

Toby Inkster

David said:
Yes ... except you would use a Transitional DTD since the DOM 1
specification states that some features assume the use of a Transitional
Doctype and the target attribute doesn't appear in Strict. :)

If I had more time I'd set the onclick event on each link. :)
 
N

nice.guy.nige

While the city slept, steve ([email protected]) feverishly typed...
Hi

I know that opening a new window (target="_blank") is a bed idea but I
have explain that to the client and he still want the links that are
link to other domain names to open in new windows.

Web Accessibility Guidelines, Checkpoint 10.1: "Until user agents allow
users to turn off spawned windows, do not cause pop-ups or other windows to
appear and do not change the current window without informing the user.
[Priority 2]"

Many nations are bringing in - or already have in place - legislation
regarding web accessibility. Point out to your client that what he wants
will break web accessibility, and could potentially land him in court.

The best way to stop users leaving your site is to provide a site that they
want to come back to. For example, on a good site, I may follow a link to an
external site, view that, then go back through the history to return to the
original site, or I may open the external site in a new window from the
context menu, so I can get back to the original site with a quick alt-tab!

Hope that helps,
Nige
 
J

jake

nice.guy.nige said:
While the city slept, steve ([email protected]) feverishly typed...
Hi

I know that opening a new window (target="_blank") is a bed idea but I
have explain that to the client and he still want the links that are
link to other domain names to open in new windows.

Web Accessibility Guidelines, Checkpoint 10.1: "Until user agents allow
users to turn off spawned windows, do not cause pop-ups or other windows to
appear and do not change the current window without informing the user.
[Priority 2]"
These days, UAs can turn off spawned windows.

The important thing is not to open a new window without first informing
the user.
Many nations are bringing in - or already have in place - legislation
regarding web accessibility.
True.

Point out to your client that what he wants
will break web accessibility, and could potentially land him in court.

No, not really. There's no accessibility issue here.
 
S

Spartanicus

jake said:
Web Accessibility Guidelines, Checkpoint 10.1: "Until user agents allow
users to turn off spawned windows, do not cause pop-ups or other windows to
appear and do not change the current window without informing the user.
[Priority 2]"
These days, UAs can turn off spawned windows.

Of the big 4 only Mozilla and possibly Firefox allows this, and since
this setting is not in the GUI prefs most users would be unaware of this
feature.
The important thing is not to open a new window without first informing
the user.

"Informing the user" forces knowledgable users to do something extra
which shouldn't be necessary, and the average user doesn't know how to
open such a link in the same window/tab.

The correct answer remains: stop wanting that.
 
J

jake

In message
[snip]
The important thing is not to open a new window without first informing
the user.

"Informing the user" forces knowledgable users to do something extra
which shouldn't be necessary, and the average user doesn't know how to
open such a link in the same window/tab.

The important thing is not to open a new window without first informing
the user.
The correct answer remains: stop wanting that.
The correct answer is to provide the facility if it's needed.

regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top