How to make a link open in new tab

E

ewijaya

Dear expert,

Usually, when we click on "FOO" on html below,
the page will open on the current "tab" or "window"


<A HREF=../somepath/somehtml.html class=style1> FOO </A><br><br />

How can we "force" the link openable in new browser tab/windows by
default?

I know we can right click the link in with our browser to select where
to open
it (e.g in Firefox browser), but I would like to make it default open
in NEW Tab.
 
E

El Kabong

Usually, when we click on "FOO" on html below,
the page will open on the current "tab" or "window"


<A HREF=../somepath/somehtml.html class=style1> FOO </A><br><br />

Add target="_blank" as in:

<A HREF=../somepath/somehtml.html class=style1 target="_blank"> FOO
</A><br><br />

El
 
J

Jonathan N. Little

El said:
Add target="_blank" as in:

<A HREF=../somepath/somehtml.html class=style1 target="_blank"> FOO
</A><br><br />

NO, incorrect. You may *try* to *force* a new tab or window but any
decent *modern* browser can override such attempt! More to the point
*why* do you feel the need to open a link in a new window? Simple
solution is just don't and let your users decide whether or not that
they want to open the link in a new window, tab, or different browser!
Leave the choice to them.

BTW: El, Quickdraw or whatever, your example is more harmful then
helpful for a newbie, it is a hodgepodge of HTML and XHTML. If you meant
HTML then what is "<br />"? If you meant XHTML then uppercase elements
and unquoted parameters are invalid.
 
E

El Kabong

Jonathan N. Little said:
BTW: El, Quickdraw or whatever, your example is more harmful then helpful
for a newbie, it is a hodgepodge of HTML and XHTML. If you meant HTML then
what is "<br />"? If you meant XHTML then uppercase elements and unquoted
parameters are invalid.

I didn't mean either it was a mere "Copy & Paste"... only added the target
attribute and didn't bother to edit.

Sorry.

However, we disagree about the usefulness of this attribute.

Sometimes, particularly on a page featuring a list of links on a similar
subject, it might be desirable to have the visitor remain at your site while
liberally exploring the new link in a separate window or tab.

No harm in that, is there, Mr. Small?
 
?

=?ISO-8859-1?Q?G=E9rard_Talbot?=

El Kabong wrote :
Add target="_blank" as in:

<A HREF=../somepath/somehtml.html class=style1 target="_blank"> FOO
</A><br><br />

El

Not true. A target _blank will open an unnamed secondary window. Not a
tab. A web author can not force the opening of a new tab. Windows and
tabs management should be completely and absolutely in the users' veto
powers.

Gérard
 
E

El Kabong

Not true. A target _blank will open an unnamed secondary window. Not a
tab. A web author can not force the opening of a new tab. Windows and tabs
management should be completely and absolutely in the users' veto powers.

Gérard

I stand corrected, and I agree that tab management is properly left to the
user. I find them annoying anyway because they kill the "Alt+Tab" function.

Example: If I am browsing a page with a list of links to sites providing
additional information regarding the subject of this page, I want this
current window to remain open while I peruse the list. I may even want to
have more than one of the new sites open at the same time for comparison of
features or details. Then I can "Alt+Tab" back and forth through the sites
to my heart's content and close them with a click when I'm tired of them.

Very, very useful for researching products, price comparison, etc. One of
the many delightful wonders of Cyberspace, but I will agree that it can be
irritating if the developer uses it merely to hold a visitor's eyes for an
extra "look". That's as rude as a pop-under.

Thanks,

El
 
E

El Kabong

Example: If I am browsing a page with a list of links to sites providing
additional information regarding the subject of this page, I want this
current window to remain open while I peruse the list. I may even want to
have more than one of the new sites open at the same time for comparison
of features or details. Then I can "Alt+Tab" back and forth through the
sites to my heart's content and close them with a click when I'm tired of
them.
A post-script to this:
My view here is optimistic that the visitor is actually interested in the
list I am presenting. Therefore I create the links with the _blank target to
assist them in perusing the list. To omit them is to assume your list is
uninteresting or will only have one link that is of interest, so the rest
can be left behind and possibly never seen again.

And that's all I have to sway about that. ;-)
 
B

Bergamot

El said:
My view here is optimistic that the visitor is actually interested in the
list I am presenting. Therefore I create the links with the _blank target to
assist them in perusing the list.

All you've really done is assist them in opening deity knows how many
extra browser windows, cluttering up the task bar so that it is now
difficult to find anything, including your page.

Besides, opening new windows breaks the 'back' button, which is an even
bigger sin.
To omit them is to assume your list is uninteresting

Only in your own mind.
 
D

dorayme

Gérard Talbot said:
El Kabong wrote :

Not true. A target _blank will open an unnamed secondary window. Not a
tab.

This is not quite true. Some browser preferences allow for a
target="_blank" to open in a tab and some people have it so set
up. My iCab, for example.
 
A

Adrienne Boswell

Dear expert,

Usually, when we click on "FOO" on html below,
the page will open on the current "tab" or "window"


<A HREF=../somepath/somehtml.html class=style1> FOO </A><br><br />

How can we "force" the link openable in new browser tab/windows by
default?

I know we can right click the link in with our browser to select where
to open
it (e.g in Firefox browser), but I would like to make it default open
in NEW Tab.

As others have said, you cannot force that. However, what you _CAN_ do
is offer some sort of instructions eg:
<p>If you would like to see these links in a new tab or window, consult
your browser's documentation...</p>

You see, there are people like me who use mouse gestures, and therefore
never look up at the menu bar. I just gesture until I a) figure out
there is no back button or b) I just get pissed off and close the
window/tab and the offending web site that did it in the first place.
 
?

=?ISO-8859-1?Q?G=E9rard_Talbot?=

dorayme wrote :
This is not quite true. Some browser preferences allow for a
target="_blank" to open in a tab and some people have it so set
up. My iCab, for example.


Well, that is your preference. A number of browsers now allow users to
override the target="_blank" attribute specification and/or target
attribute altogether that way, if set by the user. But the default
standard action (according to HTML 4) is to open an unnamed secondary
window.

Gérard
 
J

Joel Shepherd

El Kabong said:
I stand corrected, and I agree that tab management is properly left to the
user. I find them annoying anyway because they kill the "Alt+Tab" function.

Hrmm? On Windows? In what browser?

Any tabbed Windows browser that I've used happily switches tabs with
Ctrl+Tab; Alt+Tab continues to work as usual.
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top