views:

73

answers:

4

Is target=_blank the best way or is there something else that has replaced it?

+4  A: 

This IMO is still the best way to do it. And will work with any sane browser even when everything else like javascript and the like fails. Even as I seem to recall that the target attribute at some time was removed from one or the other XHTML standard (I think XHTML Strict).

jitter
+1  A: 

It disappeared in XHTML Strict, but it would appear that target="_blank" will remain in HTML5, but browser makers will be encouraged to allow users to disable the behaviour (and default it to disabled).

ceejayoz
A: 

In this article at 456 Berea Street, Roger Johansson recommends using JavaScript instead of the _target attribute, as the _target attribute is invalid in strict HTML/XHTML. However, he also recommends you avoid making links open in new windows as much as possible.

Steve Harrison
Right, use the option that could be disabled when target is consistently interpreted by browsers... Yet another reason using strict isn't a great idea.
OMG Ponies
A: 

Remember HTML is only meant for content, not behaviour. Hence we have CSS for layout and JS for behaviour. For that reason you should use JS for the open in a new window functionality. This is why XHTML strict doesn't allow target="_blank".

John Polling