Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hyperlink question

Status
Not open for further replies.

moirakris

Technical User
Oct 11, 2002
82
Ok this should be apparant but for some reason (prolly because it's 6am and I haven't been to sleep yet) my brain can't figure this out.

thread215-172851 was the only post I found that was close but it didn't answer my question.

I have a page overflowing with links. I want the majority of them to open into a new window and a few to open into the same window.

Now I know I can do the
Code:
<A HREF=&quot;[URL unfurl="true"]http://www.mysite.com/&quot;[/URL] TARGET=&quot;display&quot;>LINK</A>
to open the ones I want into a new window but it would be MUCH easier if I could have just a plain
Code:
<A HREF=&quot;[URL unfurl="true"]http://www.mysite.com/&quot;<LINK<A>[/URL]
with no target specified open into a new window and somehow target the ones I want to load into the same window something else. Kinda bass-ackwards from the norm if you know what I mean.

Does this make sense? Anyone know how to do this to save my sanity and my fingertips?

Thanks a bunch :) Moira
&quot;Those that stop learning, stop living.&quot;
 
Try adding this to the <head>:
<base target=&quot;display&quot;>

Then change the ones to open in the same window.

Rick
 
instead put this is your href=&quot;javascript&quot; onclick=&quot;window.open('your url')
[soapbox]
sleep is good
 
Ristmo

Ok I added the
Code:
<base target=&quot;display&quot;>
into the head and then 2 links like so

Code:
<A HREF=&quot;[URL unfurl="true"]http://www.url.com&quot;>Link1</A>[/URL] | 
<A HREF=&quot;[URL unfurl="true"]http://www.url2.com&quot;[/URL] target=&quot;abc&quot;>Link2</A>

Link 1 now opens into a new window instead of the same window [woohoo] but alas link 2 does as well, bah.

Any ideas? Using IE 5.5 if that helps any...this isn't a page for the general public so I won't have to worry about it working with other browser platforms. Moira
&quot;Those that stop learning, stop living.&quot;
 
<A HREF=&quot; target=&quot;_self&quot;>Link2</A>
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
:::::slaps self in forehead:::: DUH why didn't I think of that.

Works now Thanks so much Ristmo and DeZiner
:::happydances around my desk::::

Moira
&quot;Those that stop learning, stop living.&quot;
 
DeZiner--remember that 10% of all users have JavaScript disabled. If you can do the same thing in HTML, do it that way, instead.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top