469,912 Members | 1,871 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,912 developers. It's quick & easy.

<base target="???">

Hi!

Is there any way to set <base target="_blank"> for links which link to a
page outside the domain, and <base target="_self"> for links which link to a
page inside the domain?

Can i do such a thing in the global.asa file or maybe in an other include
asp file? I am working on a site with 3-4000 hyperlinks, and I do not look
forward to "marching" through every each one ove them and set target to
_blank og _self...

Thanks in advance

Lars Schlanbusch
Jul 19 '05 #1
3 4382
Gazing into my crystal ball I observed "Lars Schlanbusch"
<la**@schlanbusch.no> writing in news:3f********@news.broadpark.no:
Hi!

Is there any way to set <base target="_blank"> for links which link to
a page outside the domain, and <base target="_self"> for links which
link to a page inside the domain?

Can i do such a thing in the global.asa file or maybe in an other
include asp file? I am working on a site with 3-4000 hyperlinks, and I
do not look forward to "marching" through every each one ove them and
set target to _blank og _self...

Thanks in advance

Lars Schlanbusch


This is probably another one of the reasons that the target attribute was
removed from XHTML Strict. Let the user decide if they want to open the
link in a new window or not. Remember there are many browsers out there
now that block commands to open new windows - even those with just the
target attribute, including javascript.

Additionally, I see you asking about _self. You're not using frames, are
you? Tsk, tsk, tsk.... unfriendly for visitors, search engines, etc.

As for putting something like that in a global.asa I would think not. The
target attribute is client side, not server side.

If you insist on opening new windows, and your links are generated from a
table, then you could add a field called maybe "outside", test whether the
link is outside or not, and build your a element accordingly.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 19 '05 #2

"Adrienne" <ar****@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
Gazing into my crystal ball I observed "Lars Schlanbusch"
<la**@schlanbusch.no> writing in news:3f********@news.broadpark.no:
This is probably another one of the reasons that the target attribute was
removed from XHTML Strict. Let the user decide if they want to open the
link in a new window or not.
The problem here is that the site I am making don't want the user to "walk
away" from the site because he or she opens a link.
Remember there are many browsers out there
now that block commands to open new windows - even those with just the
target attribute, including javascript.

Additionally, I see you asking about _self. You're not using frames, are
you? Tsk, tsk, tsk.... unfriendly for visitors, search engines, etc.
Nope, I am not using frames, so actually I shouldn't use _self, but _top :o)

As for putting something like that in a global.asa I would think not. The
target attribute is client side, not server side.

If you insist on opening new windows, and your links are generated from a
table, then you could add a field called maybe "outside", test whether the
link is outside or not, and build your a element accordingly.
The problem here is that I have so many links, and i REALLY don't want to
"walk through" every single one of them specifying if they are external or
internal links if I don't HAVE to. The links are not in a table, they are
parts of long texts..

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com

Jul 19 '05 #3
Gazing into my crystal ball I observed "Lars Schlanbusch"
<la**@schlanbusch.no> writing in news:3f********@news.broadpark.no:

"Adrienne" <ar****@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
Gazing into my crystal ball I observed "Lars Schlanbusch"
<la**@schlanbusch.no> writing in news:3f********@news.broadpark.no:
This is probably another one of the reasons that the target attribute
was removed from XHTML Strict. Let the user decide if they want to
open the link in a new window or not.


The problem here is that the site I am making don't want the user to
"walk away" from the site because he or she opens a link.


If the user wants to walk away, that is their right. You should never
force anything on the user. Further, by opening a new window, you have
broken the back button. Some users are confused when a new window is
opened and they think there is no way to get back to where they originally
were.
Remember there are many browsers out there
now that block commands to open new windows - even those with just the
target attribute, including javascript.

Additionally, I see you asking about _self. You're not using frames,
are you? Tsk, tsk, tsk.... unfriendly for visitors, search engines,
etc.
Nope, I am not using frames, so actually I shouldn't use _self, but
_top :o)


Actually, you should not have to use a target attribute at all if you are
not using frames.

As for putting something like that in a global.asa I would think not.
The target attribute is client side, not server side.

If you insist on opening new windows, and your links are generated
from a table, then you could add a field called maybe "outside", test
whether the link is outside or not, and build your a element
accordingly.


The problem here is that I have so many links, and i REALLY don't want
to "walk through" every single one of them specifying if they are
external or internal links if I don't HAVE to. The links are not in a
table, they are parts of long texts..


Again, let the user decide if they want to open the link in a new window.
Personally, this is something that I do all the time, and I'm sure that I'm
not alone.
--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kai Grossjohann | last post: by
3 posts views Thread by Jim Carlock | last post: by
10 posts views Thread by Gernot Frisch | last post: by
5 posts views Thread by Joe Kovac | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.