target="_blank"
- Started
- Last post
- 29 Responses
- slinky
hey is there anyway or any code to add to a site that will make all external links on a site open up in a new window without having to go through 1000s of links and adding target="_blank" to all the external links.
client side or server side.
- version30
javascript, how do you think it works here?
- todelete__20
if you can't do it with java can you do a find and replace?
- JazX0
I aws thinking what kOna said, find some sinppet of code that is similar in each link and Find and Replace
- version30
increase page weight?
- todelete__20
cntl-alt-your screwed
- Jaline0
cntl-alt-your screwed
kOna
(Apr 14 05, 09:32)cntl-alt-you're screwed
just to piss you off
- SteveJobs0
replace '[a'
with
'[a target="blank"'
most ide's support replace all for multiple pages in a project
- blaw0
in the head of the doc put
[base target="_blank"]
- version30
blaws got a good solution there depending on how many actual documents you have
could that be added as a css class?
does the site use a css file?
- mg330
I don't know what I would do without Find & Replace.
- version30
I don't know what I would do without Find & Replace.
mg33
(Apr 14 05, 09:45)
---------------------
find a replace the hard way most likely
- blaw0
even with a ton of documents you could simply replace:
[/head]
with:
[base target="_blank"]
[/head]
- todelete__20
cntl-alt-your screwed
kOna
(Apr 14 05, 09:32)cntl-alt-you're screwed
just to piss you off
Jaline
(Apr 14 05, 09:34)
++++++++++++++++
hey, i never claimed i was a mathmetician.besides silly, there is no you're key on the keyboard, only a your. it's a microsoft error.
- JazX0
I declare a new NT rule, even though I am in no position to declare anything. You don't have to properly abbreviate you are as in you're I always miss that
- blaw0
your out of line, jazx.
- version30
even with a ton of documents you could simply replace:
[/head]
with:
[base target="_blank"]
[/head]
blaw
(Apr 14 05, 09:47)true but still adding unneeded page weight
CAN IT BE PUT IN A CSS CLASS OR NOT?!?!?!?!?
*goes to try
- dc_again0
think you'll find that what you're looking for is:
http://www.oneplayer.co.uk/dump/…
i didn't write this, Travis over at squidfingers did.
and i won't mention that kOna did the schoolboy error of linking 'javascript' with 'java'(!!!) ;)
- Engage_London0
find...
link="
replace with...
target="_blank" link="
- heavyt0
but i think that internal links need to opne in the main window. Only links out need to be in a new window.
Therefore you will need to search the strings to see if they start with your base URL, if not make target blank.
i would probably do it is an ext loaded javascript.
has to search for indexOf 'href' and then find instances the base URL and then find the indexOf 'target=' and set taht to blank.TR1
- JazX0
target="_jazx"
But seriously watch it, if you put that tag in it takes you straight to a live feed from Hell.