473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

<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 4544
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kai Grossjohann | last post by:
The following HTML file invoker.html creates a modal dialog: <html><head> <script language="JavaScript"> function popup() { window.showModalDialog("main.html", null,...
6
by: Tony Marston | last post by:
The code <a href="..." target="_blank">...</a> will not validate as XHTML STRICT because of the 'target' tag, so how do I achieve the same result by moving it to a CSS file? I cannot find anything...
10
by: Dieter Salath? | last post by:
Hi, in our webpage, a user could open a windows explorer to his temp directory with a simple link and usage of the file protocol: <a href="file://C:\temp" target="_blank">C:\temp</a> This...
2
by: Rez | last post by:
Hi Guys, I have a problem with exporting to excel from a modal dialog box. Basically, i have an ASPX page that gathers user criteria, and passes it to a dialogbox (showModalDialog), There is a...
3
by: Jim Carlock | last post by:
In creating a dynamic page with some static content, ie, the list of city names is standard HTML encoding. When I click on the link, I see the page reload itself instead of jumping to the content...
1
by: easy.lin | last post by:
.... <object id="10">door</object> .... I try to write this in clipse XSD editor <element name="object" type="string"> <attribute name="id" type="int"></attribute> </element> but get wrong...
10
by: Gernot Frisch | last post by:
Hi, I'm currently writing: <span onclick="window.open(...);">Klick Here</span> but I want to use the <a href> for this, since it is defined in the css script the way I want my link to open....
5
by: Joe Kovac | last post by:
Hi! I want to add <base target="_self"> into the header section of a aspx page. I want to do this in the code behind because I use master pages which I do not want to change directly. Thanks...
6
by: fran7 | last post by:
Hi, I know that <base target="_blank"> will open all links in a new window. Anyone can suggest how to use it but selectively not open all the links. I have 10 links out of 100 that I dont want to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.