5 ms·
Why you shouldn’t use target=_blank, and what to use instead
- jalada 16y agoOK so it's been pointed out to me that HTML5 didn't deprecate target=_blank like I thought. It was just XHTML that removed it, and my method uses HTML5 'data-' attributes. So it's pretty irrelevant, just carry on using target=_blank I guess?
- Sidnicious 16y agoEven if it were deprecated, I would probably keep using target="_blank" it as long as it worked. I feel that an attribute that says, "Hey, web browser, it would be great if you opened this thing in a new window, tab, or whatever" is fundamentally superior to binding some JavaScript code to the link's click handler.
- jalada 16y agoI agree to an extent, but one useful byproduct is people who have Javascript disabled (Noscript or similar) are perhaps the type of people that really _hate_ sites opening in new tabs/windows, so they get what they wanted with this method.