Glom Posted April 23, 2006 Share Posted April 23, 2006 It says that the target attribute is not valid in strict XHTML, yet it doesn't say that it has been deprecated. If the target attribute is not used to open a link in a new window, how do you do it? Link to comment Share on other sites More sharing options...
johneva Posted April 23, 2006 Share Posted April 23, 2006 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 More sharing options...
boen_robot Posted April 23, 2006 Share Posted April 23, 2006 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 More sharing options...
johneva Posted April 23, 2006 Share Posted April 23, 2006 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 More sharing options...
Jonas Posted April 23, 2006 Share Posted April 23, 2006 Target wasn't deprecated from Strict, because target has never been in the spesification of any strict version.W3.org HTML/XHTML Frequently Asked Questions Link to comment Share on other sites More sharing options...
johneva Posted April 23, 2006 Share Posted April 23, 2006 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 More sharing options...
Glom Posted April 23, 2006 Author Share Posted April 23, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now