We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

how to set target for all the links at one time?

SheharyaarSaahil
on
Medium Priority
399 Views
Last Modified: 2010-04-25
im fed of setting the target for hundreds of links one by one, is there an easy way out there to set the target for all the links\pictures present on a webpage at once?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Yes, you can use a BASE HREF tag.  Whatever appears in here is automatically added to any links in the browser.  This can have bad effects on images and stuff though because the base ref is also added to them.  An example is below but I think the best option is probably the Find & Replace function!


<html>
<head>
<title>My page title</title>
<base href="http://www.mysite.com/target">
</head>


Then whenever you use a link...

<a href="file.html">Link</a>

The browser actually interprets this as http://www.mysite.com/target/file.html
Jason C. LevineDon't talk to me.
CERTIFIED EXPERT

Commented:
Hi SheharyaarSaahil,

I'm not sure what you mean by "target" for all the links.  Do you mean anchor?

If so, do a search and replace in the entire site, code view, for .html" and replace with .html#yourtarget"
CERTIFIED EXPERT
Expert of the Year 2004
Top Expert 2004

Author

Commented:
@Rouchie
am i supposed to repalce the word "target" to "_blank" here?

@jason1178
im talking about the "_blank" "_self" "_parent" targets for the links and pictures.
CERTIFIED EXPERT
Commented:
Depending on what you want the target to be, yes.  Here's an example:

Replace:
   <a href=

With:
   <a target="_blank" href=

Or choose an alternative to _blank if you need to.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Jason C. LevineDon't talk to me.
CERTIFIED EXPERT

Commented:
Rouchie has it.  Search and Replace is the way to go.
CERTIFIED EXPERT
Expert of the Year 2004
Top Expert 2004

Author

Commented:
cool..... never thought of using the find and replace tool.... thanks!!!!!!! ^_^
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.