?
Solved

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

Posted on 2006-03-27
6
Medium Priority
?
386 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?
0
Comment
Question by:SheharyaarSaahil
  • 2
  • 2
  • 2
6 Comments
 
LVL 25

Expert Comment

by:Rouchie
ID: 16308429
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
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16308458
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"
0
 
LVL 65

Author Comment

by:SheharyaarSaahil
ID: 16308532
@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.
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
LVL 25

Accepted Solution

by:
Rouchie earned 2000 total points
ID: 16308555
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.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16308573
Rouchie has it.  Search and Replace is the way to go.
0
 
LVL 65

Author Comment

by:SheharyaarSaahil
ID: 16308614
cool..... never thought of using the find and replace tool.... thanks!!!!!!! ^_^
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Loops Section Overview
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question