Jump to content

Opening links in a new window


Glom
 Share

Recommended Posts

W3C say that it should be down to the user to make the option of opening in a new window and not the website designer so there is no replacement. :) Though you can use javascript to get round it but would advise against it myself.

<a href="http://www.w3.org/" onclick="window.open(this.href); return false;">W3C</a>

Here is an article on why.

Link to comment
Share on other sites

Note that CSS3 is going to have a target replacement. It's listed in the CSS3 target specification. Nowaday browsers don't support it though, so JavaScript is the only valid solution now.Besides the above simplified solution by johneva, you may define your own "classes" of target behaviour and use/alter them all at once by using this script.

Link to comment
Share on other sites

AhCool I did not know they plan on bringing it back for CSS3.Also your best of using that script boen_robot has gave a link for if your gonna use javascript to resove this issue, as it will work better.

Link to comment
Share on other sites

AhhhhhI to did not know that either.I am new I have only been playing around with web design for about 8 months, I have only been using computers for 14 months.So everyday is a massive learning curve for me.Two years ago before my car accident I was a car mechanic and did not know how to use a computer at all.But cos my neck and back injury I have been learning how to use computers I wont bore you no more anyways.Though it is all in my website if you check it out. :)

Link to comment
Share on other sites

Fine, I'll get rid of that. I was only using it for external links anyway. My preference has always been for opening links in a new window and I always find it more convenient when a web page does it automatically.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...