Live data from Hacker News

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

kyrylo.org

71–80 of 203 posts

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

#71
Tangential, but I would really like frames to come back for incremental document updates, like LiveView/Hotwire/HTMX. You can just start working like that today with one of those libraries, but it would be so neat to have a common standard for describing an update to a targeted frame.

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

#72
post #41

So basically It’s an “_blank” because it is.. Author’s description is, “because if it wasn’t _blank.. it wouldn’t open a new tab.” Reminds me of some university professors I had.

The general trend in search engine results seems to be optimising towards these superficial and unsatisfying answers too... and part of it is no doubt due to sites like this.

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

#73
post #60

Earlier quoted context omitted.

Probably inspired by C and C++ which reserve names starting with an underscore for the implementation (more precisely, they reserve names starting with `_[_A-Z]` everywhere, and all other names starting with `_` in the global scope only).

I nice factoid: in Erlang, `_` if functional. It means "I don't care about this variable". When pattern matching you can put `_` to not bind value in function or pattern to anything or prepend a variable with `_` to tell compiler that you won't be using it, but it's there for "documentation" purposes. For example `[A|_]=List` will extract first element of list into A and ignore rest of list. Underscore has some other…

Yes, many languages use `_` as a placeholder name, and at least in Rust any name starting with `_` is considered intentionally unused.

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

#74
post #41

So basically It’s an “_blank” because it is.. Author’s description is, “because if it wasn’t _blank.. it wouldn’t open a new tab.” Reminds me of some university professors I had.

When I built "webapps" in the 90s, they were a collection of frames. You could just do everything as one page, but there were some neat things you could do by dividing the page up into frames + internet connections were not very good so if you had something you needed to update a lot, it was easier to make it it's own .html and server it in an iframe.

Because you could "NameAFrameAnyThingYouWanTED" they made some magic targets, _blank window to open a blank window (we have tabs, then we did not), _self to open in the same frame or window, _parent to open in the parent frame, _top to break out of frames entirely (this is how you would bypass the ad some free .coms would inject into your site)

When I read the html spec in the 90s all it says was you can name a frame anything except don't use _ as _ is reserved for special frame types.

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

#78
post #38

Earlier quoted context omitted.

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

The headline of the article is a rhetorical question, one that the article itself then answers in detail. It's a very common device.

Yes, it is a common clickbait tactic. Also, rhetorical questions, by definition, don't get answered. If it's rhetorical then the article content is pointless? I don't see why this bothers you all. Saved me a click so I appreciate the comment.

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

#79

Tangential, but I would really like frames to come back for incremental document updates, like LiveView/Hotwire/HTMX. You can just start working like that today with one of those libraries, but it would be so neat to have a common standard for describing an update to a targeted frame.

Isn't that the use-case for Micro Frontend Architecture? I've always viewed it as a second-coming of Frames. https://micro-frontends.org/

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

#80

Tangential, but I would really like frames to come back for incremental document updates, like LiveView/Hotwire/HTMX. You can just start working like that today with one of those libraries, but it would be so neat to have a common standard for describing an update to a targeted frame.

HTML has a bunch of good stuff in it that'd replace the need for so much heavy and slow and non-native-feeling javascript if that'd just been improved. Lots of it's now rarely used because it sucks, but there's no good reason it has to suck. It's like whole sections of the spec just got abandoned around 2005, but the need is still there.
Post reply on HN