Forum Moderators: phranque
OTOH, target blank is deprecated in strict html and xhtml. So the w3c don't agree with me. I know there is bulky javascript (not used by 20% or so of users) and other clunky methods, but none are as neat as
target"_blank" What do you do, particularly on commercial sites?
I've recently re-done our web site in XHTML 1.0 strict and ran into exactly that problem. I have gone the Javascript way to open external links in a new window. If JS is not activated, then the page will open in the same window, but these days one misses out on so much on the web if JS is disabled that I think users may get more savvy in toggling the option.
Also, if your estimates are correct that 20% have JS disabled, that still leaves me with good odds. If the others have to hit the back button to come back to my site, so be it.
cheers
tey
You pegged the issue when you said many users expect and like new windows sometimes; many of my visitors also appreciate that offsite links open a new window. They're normally interested enough in what they're viewing on my site that they'd like to "hold their place," but they're interested enough in the offsite link to give it a look, too. And most don't even know they can open new windows themselves, which puts the decision right in our laps as far as I can tell.
Regarding the web standards, the <br> tag and target="_blank" are two of the biggest mistakes they've made about what to deprecate, in my opinion. Both are among the few small bits of invalid code I'm actually willing to use on my site, when there's a good reason.
<rabbit trail>Which brings up a related issue on validation...I've always held that outright validation isn't nearly as important as knowing what valid code is and making an informed decision about what, if any, invalid code you'll use. </rabbit trail>
Incidentally, unless you're catering to an audience that is really picky about seeing a "Validated" graphic on your site, I'd just forget about complete validation and use the target="_blank" instead of a JS solution. Javascript just isn't as stable or universal as the target option.
Regarding validation and accessibility, I also believe it's valid code is a good first step toward accessibility. But I think opening new windows is kind of a catch-22 situation. We do it to improve accessibility in some situations, yet target="_blank" is invalid code, and therefore it's not as accessible as we could wish. We're therefore left with javascript, but by its very nature, it's not generally considered accessible either. So we know the result we want, and we have two un-ideal choices to reach the objective.
Take your pick between the two - I won't pretend to know the right answer. I prefer target="_blank" to a javascript solution. I certainly wouldn't say that my answer is the best for everyone, however.
I find it absolutely mind-boggling that even xhtml does not support client-side includes. This could be achieved as simply as <div src="url">upgrade your browser</div>. The idiots in charge of standards are just that - idiots.
Kaled.