06-15-2003, 06:46 PM | #1 (permalink) |
Fear the bunny
Location: Hanging off the tip of the Right Wing
|
How can I make links re-direct in a new window?
I have a few links on my site that link to other sites, but it does so in the same window. What HTML script do I have to write to make a new window open so the view will also stay at the original page at my site?
__________________
Activism is a way for useless people to feel important. |
06-15-2003, 06:49 PM | #2 (permalink) |
Fluxing wildly...
Location: Auckland, New Zealand
|
Code:
<a href="http://link" target="_blank">link</a> EDIT: Bleh, the [code] tag doesn't work properly
__________________
flux (n.) Medicine. The discharge of large quantities of fluid material from the body, especially the discharge of watery feces from the intestines. |
06-16-2003, 07:16 AM | #5 (permalink) |
Sir
Location: Colorado Springs, CO
|
you can also do :: target="_blank" :: for this.
__________________
If you like what you see, donate to the TFP |
06-16-2003, 01:58 PM | #6 (permalink) |
Crazy
Location: Copenhagen, Denmark
|
Check this out. It is a little more complex, but it alllows for a lot more flexibility.
PHP Code:
Last edited by crazycousinjim; 06-16-2003 at 02:07 PM.. |
06-16-2003, 04:40 PM | #7 (permalink) |
Fucking Hostile
Location: Springford, ON, Canada
|
Bah.. I really hate it when webmasters force me to browse their way with non-resizable windows. At least make resizable=yes, or try it out on as many browsers as you have access to since not all browsers render the same.
__________________
Get off your fuckin cross. We need the fuckin space to nail the next fool martyr. |
06-16-2003, 07:53 PM | #8 (permalink) |
Addict
Location: Dodging the ice pick
|
When you add the target attribute to your anchor tag you can give it a certain name. target="_blank" will always open a new blank window but you don't have to do this. If you want you can have all your links open in a window different than your page is on but they will all open in the same one.
Let me explain it better. Say you added target="link" to all your links. On your page you included a link to CNN, Toms Hardware, and the TFP. Now say I was on your site and I clicked on the CNN link. It would get a new window with CNN. Then I clicked on the lead story on CNN and I still have two windows. One with your page and another with the lead CNN story. Now say I switched back to your page and I clicked on the TFP link. TFP would open up not in an entirely new window but the one where the CNN story is. The is because the target attribute give the new window a name, in this example "link". So each link that points to the windows named "link" will open in that window even if the site currently display is not what was originally opened in that window.
__________________
COYW |
06-17-2003, 10:12 AM | #10 (permalink) |
Crazy
Location: Copenhagen, Denmark
|
I have to disagree. Although you can do it much easier with the target. You can get much more control over the window layout and such. If you are opening up a page for announcements or or help page then why waste all that valuable pixel space with chrome. I just depends what you want I guess.
|
06-18-2003, 07:33 AM | #11 (permalink) | |
Bringer of good Moos...
Location: Midlands, UK
|
Quote:
Give the users of your site the option of opening in a new window or not. Ok, you have to use javascript, but it works great! Have a look at http://www.dynamicdrive.com/dynamicindex8/newwindow.htm and http://www.dynamicdrive.com/dynamicindex8/newwindow2.htm edited cause I can't type! Last edited by cowudders14; 06-18-2003 at 07:36 AM.. |
|
Tags |
links, make, redirect, window |
|
|