3 ms·
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
by bilekas 2y ago
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.
- systems_glitch 2y ago"I dunno...is magic" (engineering Calculus II GTA, Virginia Tech, 2006)
- rendaw 2y agoAnd a lot of SO answers.
- Aachen 2y agoI was more thinking of javadoc, or other languages where people can automatically generate documentation from the code comments they wrote and 97 out of 100 comments is the function name written as a sentence ("reserveItem(): reserves an item") For anyone who writes these, please just leave it blank and revisit it later
- russfink 2y agoI second your motion.
- mdaniel 2y agoMy experience with this is it is almost always caused by some heavy-handed linter rule, e.g. "fail CI if methods don't have javadoc". Most of those "dumb" linters also almost never catch when a parameter has been renamed but its "@param" was left intact. Drives me crazy. see also https://en.wikipedia.org/wiki/Goodhart%27s_law https://en.wikipedia.org/wiki/Goodhart%27s_law
- userbinator 2y agoThe 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.
- neom 2y agoWhen 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.
- sokols 2y agoThis is exactly what I understood from the article. Your explanation didn't add anything extra.
- lazide 2y agoI actually used the 1.0 version of Netscape Navigator, and did some web development on it back in the day. Originally, _blank, _new, etc. weren’t special. A target ref to a name which wasn’t used would open a new window. If it was already used, it would take you to that open window. People started using _whatever because just ‘blank’ would almost always cause a collision. Eventually it got standardized that it would always open a new blank window.
- tredre3 2y agoIf what you say is accurate then it should have been in the article. Because, as is, GP is correct that it doesn't answer the question!
- pests 2y ago>(this is how you would bypass the ad some free .coms would inject into your site) In anglefire and maybe geocities we would serve the document with a .txt extension and it would also skip the ads but browsers, with their liberal acceptance policy, would render normally.
- layer8 2y agoMaybe the article didn’t make it clear enough, but having special targets begin with an underscore has the purpose of avoiding name collisions with normal targets. The primary thing the article does is explain that there are normal targets in the first place, which is probably the main aspect people might otherwise be missing.
- mixmastamyk 2y agoYes, whenever you see such a convention it’s about expanding the namespace. i.e. avoiding the main namespace.
- mikeyinternews 2y agoIt would open in a new tab (or specifically, window) if there was no object named "blank" for it to target. The problem with that is subsequent links with the target "blank" would use this same new window. Links with the target "_blank" would each open in individual windows
- layer8 2y agoNot quite. Any name would open a new window unless a frame with that name already exists. This includes the case of the name “blank”. In other words, the first time clicking on a link targeting a name would open a new frame (window) with that name, but the second time would load the content into the existing frame, replacing the previous content. In that scheme, there is no way to open an additional new frame each time. The reserved name “_blank” was then defined to have that semantics.
- bilekas 2y agoSo again as I understand, it's simply because a standard was decided ? > The (reserved) name “_blank” was then defined to have that semantic. I guess I was hoping for some interesting quirk with older browsers or something.
- layer8 2y agoIt was to avoid the situation of someone naming a frame “blank” without being aware of it having special semantics, or (I’m not completely clear on the history) avoiding breaking compatibility with existing use. That’s much more unlikely with a name like “_blank”. It’s common practice to separate out names with special semantics from general-use names in a syntactic way like that. There’s also “_self”, “_parent”, and “_top”. It’s an extensible scheme where HTML can add further names with special semantics in that reserved name space. I now agree that the article doesn’t make a particularly good job in explaining all of this.
- reverendsteveii 2y agoIt is what it is because it's that. You can tell, you just have to look at how it is. If it's like that, then it is what it is. If it isn't what it is it would be something that it isn't but still be what it is. Luckily for us it's what it is, not what it isn't.