Why does target="_blank" have an underscore in front? (2024)
71–80 of 203 posts
Re: Why does target="_blank" have an underscore in front? (2024)
#72So 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.
Re: Why does target="_blank" have an underscore in front? (2024)
#73Earlier 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…
Re: Why does target="_blank" have an underscore in front? (2024)
#74So 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.
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)
#75Wait, so frameset is basically htmx?
Always thought it was a creatively simple solution, but had no idea the pattern had existed (and was used) for so long.
Re: Why does target="_blank" have an underscore in front? (2024)
#76Re: Why does target="_blank" have an underscore in front? (2024)
#77Because making "blank" a reserved word would've been so much harder than making "_blank" one... /s
This is the actual answer and TFA somehow missed it completely.
Re: Why does target="_blank" have an underscore in front? (2024)
#78Earlier 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.
Re: Why does target="_blank" have an underscore in front? (2024)
#79Tangential, 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)
#80Tangential, 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.