coding to open linked sites in different window
Hi-
How do you make it so that when someone clicks on a link
to another site outside of yours, that the new site opens in
a different window?
So the result is that your site remains open and the linked site
is also open, and when they are done with the linked site they can
just close it and continue on at your site.
Any help is appreciated.
CBC58
The Webmistress posted this at 14:03 — 9th January 2004.
She has: 5,586 posts
Joined: Feb 2001
All you need to do is add target="_blank" to your link
Suzanne posted this at 14:30 — 9th January 2004.
She has: 5,507 posts
Joined: Feb 2000
If you're using XHTML strict, you need to control it through scripting instead of the markup. Any language below XHTML 1.0 Strict you can use the target attribute as Julia said.
With XHTML 1.0 Strict, you have to extend the DTD to use the target attribute, or use scripting. See Accessify.com for the full details.
cbc58 posted this at 19:27 — 9th January 2004.
They have: 140 posts
Joined: Nov 2003
Thanks.
That works.... and now I have another question.... is there
a way to make it so that the window that opens doesn't entirely
cover up my existing page.?
In other words... can I tell the link to open the linked
page at say 75% of actual size?.. so that the user can see that
a separate new page has indeed opened.
Thanks
druagord posted this at 20:09 — 9th January 2004.
He has: 335 posts
Joined: May 2003
with this technic the window will open at the default size wich you can't control to specify a size you will need to use a popup (window.open in javascript) but that can be blocked by popup killer
IF , ELSE , WHILE isn't that what life is all about
Suzanne posted this at 20:49 — 9th January 2004.
She has: 5,507 posts
Joined: Feb 2000
zerocattle.com/examples/popUp.html
If you use this code, the popup with not be blocked (or will, hopefully, not totally screw people over if they choose to open in a new tab instead).
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.