Using doctype xhtml strict will create validation error for using target="_blank". Is there a way around this WITHOUT using javascript?
Using doctype xhtml strict will create validation error for using target="_blank". Is there a way around this WITHOUT using javascript?
Didn't know about that, found this on my travels though: How to replace target="_blank" for XHTML strict w3 compliance - StatCounter User Forum
Or you could just change it to transitional and happily use the target tag as much as you like.
EDIT: Didn't see the without javascript part. I think it's a no then. You will have to change to transitional if you want it to validate.
Are there any pros/cons to transitional vs srtict?
Not at all really. As you know it's just a level that you are trying to code to, and the validator tells you how well you are coding to the level you are shooting for.
The target attribute is obviously being made a deprecated tag in xhtml strict, which makes sense seeing as purists want the user to be in control of everything when browsing a website, and this tag forces a new window on the user. Kind of javascript-esque in a way.
By going with transitional it just means that you want to use the target attribute on your site and still want the page to validate. It doesn't mean the site is any less well-constructed. It's the same as if you want to use capitals in your code like <STRONG>word</STRONG>, it's acceptable for HTML 4.01 level coding and will render perfectly fine, but it's not up to the level of xhtml (where you should use all lower case).
If you really want to stick with strict then you are going to have to do without forcing the new window, but that's another debate in itself!
EDIT: As a suggestion, you can always make your outbound links a different colour so that visitors will know that they are being taken to a poker room or out of your site. You can use a clever piece of CSS to do this, and your visitors won't ever be surprised when they click on a link and get taken away from the site. They will still open in the same window of course, but visitors will be prepared to CTRL+click instead and so it will improve usability.
Outbound Link Colour
Thanks Greg![]()
I don't see the point of worrying about this sort of error with validation.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks