Live data from Hacker News

Why does target="_blank" have an underscore in front? (2024)

kyrylo.org

21–30 of 203 posts

Re: Why does target="_blank" have an underscore in front? (2024)

#22
post #9

Shower thought: ` ` should transfer a link in a desktop into my phone. Same goes for `target="_desktop"` but in the opposite direction.

[flagged]

That IP rating for my phone got be be useful for something

Re: Why does target="_blank" have an underscore in front? (2024)

#23

Minor nitpick: browsers used _blank as a special directive to open the link in a new “window”, not a tab. Browsers didn’t have tabs back then, well other than Opera 4.x which was a paid software which never cracked 3% marketshare.

Author here — thank you! You're absolutely right, and I've corrected it!

Re: Why does target="_blank" have an underscore in front? (2024)

#25

The answer is a little unsatisfying to me. It says that "blank" ca be a frame name, but doesn't say why "_blank" can't be.

Yeah it’s not a great explanation.

To me (and I’m of the era they’re describing so I used it a lot) it’s simply that _blank is a reserved keyword that means open the link in a new, unnamed window.

Other reserved keywords for “target” are _self (default value), _parent, and _top.

https://www.w3schools.com/TAgs/att_a_target.asp

Re: Why does target="_blank" have an underscore in front? (2024)

#26

The answer is a little unsatisfying to me. It says that "blank" ca be a frame name, but doesn't say why "_blank" can't be.

I'm guessing it was possible before the window-opening behaviour came in (unless it was always there from the genesis of frameset), but it was assumed that the underscore prefixed version would be less likely to conflict with existing code than without.

I'd be interested to hear either a citation proving or disproving that guess though.

Re: Why does target="_blank" have an underscore in front? (2024)

#27
post #11

Earlier quoted context omitted.

Should it really be up to the Website designer to decide? On Firefox I have the "Send Link to Device" context action that allow me to open a link on my Phone or Desktop.

In my product we have a photo app and for normal people it is just easier to have the transferred to the phone than to use a desktop computer (without a camera) to grab a picture. We use QR codes to transfer the user - a solution would need to be as simple as that (Ie. not requiring the user to be logged in on the same browser or other shenanigans). The current solution is a hasle, but works well - I can't envision h…

On windows you can “link” your phone to your windows account, or log into your Microsoft account in edge on mobile. That could solve the login part somehow.

Re: Why does target="_blank" have an underscore in front? (2024)

#28
post #7

FWIW, I never heard of the frameset tag, while I did use frames back then.

http://hinloopen.nl/be499.html Enjoy! (check the source)

A true modern blast from the past!

Are you still using the original Claris Home Page software to maintain the website?

Re: Why does target="_blank" have an underscore in front? (2024)

#29
post #6
post #3

Because “blank” can be a real frame name if you want to make your codebase a little harder on purpose. You still see _blank for links opening in new windows, but _parent, _self, etc not so much anymore.

The title of the post isn't asking HN users a question

Looks like a question to me. Even has a little curly punctuation mark at the end.

Re: Why does target="_blank" have an underscore in front? (2024)

#30
post #29
post #6

Earlier quoted context omitted.

The title of the post isn't asking HN users a question

Looks like a question to me. Even has a little curly punctuation mark at the end.

> The title of the post isn't asking *HN users* a question
Post reply on HN