This is a discussion on "Links directed to a new page or tab" within the Web Page Design section. This forum, and the thread "Links directed to a new page or tab are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Links directed to a new page or tab
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Links directed to a new page or tab
How can I direct all of my links to a new page or window? www.adrian-rodriguez.net
I know the old way was [code] <a href="" target="_blank" /> But what is it now? |
|
|
|
#2
|
||||
|
||||
|
Re: Links directed to a new page or tab
|
|
#3
|
|||
|
|||
|
Re: Links directed to a new page or tab
I don't know much java, can it be done without it?
|
|
#4
|
|||
|
|||
|
Re: Links directed to a new page or tab
Well, first of all it's javascript. Java is something else entirely! Second, it becomes very difficult to do what you want without using one of those two methods (target="_blank" and the javascript way).
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#5
|
|||
|
|||
|
Re: Links directed to a new page or tab
Just put this in the <head></head> of your page:
There's no need to know what it does - that is if it will confuse you.
Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
#6
|
|||
|
|||
|
Re: Links directed to a new page or tab
Actually, putting that into your <head> is not good. It creates certain issues with browsers. Take that code without the script tags, and put it into a separate document called script.js. Then, put the following into your head:
Cheers
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#7
|
|||
|
|||
|
Re: Links directed to a new page or tab
Oh...My Bad!
I just wanted to make it as easy as possible for him to use this method. I actually hadn't realised it was bad to do it this way - I thought it was just better to do it externally! Thanks, Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
#8
|
|||
|
|||
|
Re: Links directed to a new page or tab
No problem. It's just that learning something the correct way is better than learning the incorrect way, and figuring out it's bad a long time later.
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
#9
|
|||
|
|||
|
Re: Links directed to a new page or tab
Don't use javascript to sneak around deprecated code. That's just silly.
If you insist on opening windows, use target="blank". It's the simplest method. So what if it's invalid? All of the "clever" workarounds do nothing but hide the error from the validator. This code was deprecated for a reason. But really, why should you ever use this? Don't wrest control from the user. |
|
#10
|
|||
|
|||
|
Re: Links directed to a new page or tab
You see - I have no clue whatsoever.
All I did was go to the link and bring the code here - I assumed that it was the W3C way to do it! Thanks for pointing things like this out - as it is anyway, I wouldn't be forcing pop-ups on anyone or having it in a link, I much prefer to right-click and choose to open it up in a new tab or window, but when I don't want it to move and it does, I have to say it really annoys me. Thanks, Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
#11
|
|||
|
|||
|
Re: Links directed to a new page or tab
By the way, there's nothing wrong with the concept of a "pop-up" box. It is often user-friendly.
The problem is with its implementation as a new browser window. Using CSS instead, you can get all of the advantages and none of the drawbacks. Simply use absolute positioning. For example, see the behaviour of my "pop-up" boxes on http://www.badmintonbible.com: look at the preferences menu on the right; the red links "what does this do?" and "how can I use these?" create pop-up <div>s. |
|
#12
|
|||
|
|||
|
Re: Links directed to a new page or tab
Thanks for the tip Mike. I guess if people really wanted to go back to my site then it would be worth them having to type it in all over again. Happy New Year!!
|
|
#13
|
|||
|
|||
|
Re: Links directed to a new page or tab
Quote:
You can't stop users leaving your site, but you can annoy them by trying. Ironically, opening a new window/tab makes it harder for users to return to your site, because the back button -- the most fundamental user navigation mechanism -- will not work. And happy new year to you, sir! |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| links page | littlebilly | Starting Out | 7 | Jul 25th, 2007 20:22 |
| How is a links page structured? | dlking1000 | Link Building and Link Sales | 1 | Apr 27th, 2007 23:42 |
| Anchors. and links within the same page | Accurax | Web Page Design | 3 | Feb 23rd, 2007 19:50 |
| links to different points on the same page | bruno89 | Web Page Design | 13 | Nov 9th, 2006 00:14 |
| Numbered links to every page | dinahdoey | Classic ASP | 5 | Sep 12th, 2004 17:01 |