Live data from Hacker News

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

kyrylo.org

31–40 of 203 posts

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

#32
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…

Sounds like a new product idea for services a la "login via apple-id/windows/google/...". Name it something like "send session to..."

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

#33
post #8

My first "web app" used frames, it was good times. Some time later I used backbone.js, and while it was still good times, it did get a lot more complicated (e.g. having to manually disconnect and reconnect 'child' elements when the main element re-rendered so that they would retain their event handlers).

Ouffff, I haven't heard of backbone.js for a long time. Yeah, my first web also used frames and framesets, then I discovered iframes and it was a whole new world! I didn't need PHP to do includes. And when with JS I could adjust the size of the iframes dinamically, that was like magic.

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

#34
post #15
post #9

Earlier quoted context omitted.

[flagged]

> SHOWER THOUGHT definition: a sudden idea that occurs to a person during an unconnected mundane activity https://www.collinsdictionary.com/dictionary/english/shower-...

Its a tongue-in-cheek comment

https://www.collinsdictionary.com/dictionary/english/tongue-...

(Not mocking, I just really liked the explanation and it happened to be the same site)

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

#35
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

True, but most people will have clicked through to the HN comments without reading the actual article. So I suppose it's helpful for the comments to give a succinct answer to the question for the people who don't know.

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

#36

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

But why was _name the naming syntax for reserved keywords, specifically?

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

#37

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

Also worth noting that "_new" is NOT a reserved keyword, but it is sometimes mistakenly used instead of "_blank". Which can lead to funny behavior if you are visiting 2 or more sites making this mistake, as the links could then start opening in windows that were initially opened by the other site. Or least that's how it was back in the days of popup windows, before tabs and popup blockers became the norm.

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

#38
post #29

Earlier quoted context omitted.

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

So everyone else then? Sounds like someone is just grumpy today.

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

#39

Earlier quoted context omitted.

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…

Sounds like a new product idea for services a la "login via apple-id/windows/google/...". Name it something like "send session to..."

The issue, as also described in the comment, is that it is a hard no-go to assume that the user is logged in on the same device.

It is a shame that the family computer does not exists anymore - a place where you can't just assume that the same account is logged in on related devices.

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

#40
post #36

Earlier quoted context omitted.

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

But why was _name the naming syntax for reserved keywords, specifically?

I suspect, when the specification was created, "_" was already popular for private/reserved members in many programming languages. In C++, for instance, you can only start an identifier with a letter or an underscore. So it seems like a natural, intuitive choice. Whether anyone can find any corroborating evidence would be interesting.
Post reply on HN