9 ms·
I just learned about HTML redirects (2020)
- notRobot 3y ago[flagged]
- arbuge 3y agoNot 'official' and yet supported by all major browsers to this day.
- vimax 3y agoWow, I think I can use this for a runtime html log!
- vermilingua 3y agoIsn’t this exactly what’s described in the article?
- deleted 3y ago[deleted]
- 1123581321 3y agoI don’t think I’ve seen a shorter and more straightforward article go unread by the commenter.
- moritzwarhier 3y agoI remember these from when I initially taught myself HTML (4) and CSS as a kid. It's kind of amazing how parts of the spec that seem dated or obsolete can still be useful today and are even widely used in corner cases.
- lloydatkinson 3y agoYeah, I use it to direct new newsletter signups to a special url which redirects a user to my latest post. https://www.lloydatkinson.net/posts/2022/static-site-redirects-with-astro/ https://www.lloydatkinson.net/posts/2022/static-site-redirec...
- RobotToaster 3y agoIt would be nice to see a collection of "dated" or "usually forgotten" web tools like this, and how they can still be useful.
- stuckkeys 3y agoAhh. This brings back memories. I used to do this when I was using Adobe (Macromedia originally) FLASH back in the day. If no FLASH, show them the shitty version. HAHA. Good times.
- MrVandemar 3y agoYou'd be surprised how often Flash was "the shitty version" as it was almost always bloated with long load times, inaccessible content and a lot of pointless stuff that was clearly to impress the client who comissioned it, not the poor user who wanted to find something out.
- stuckkeys 3y agoO no doubt.
- Reptur 3y agoMy fav was Marquee. Could put one inside the other, make one vertical, add some text and watch it bounce around like the DVD screensaver logo.
- dixie_land 3y agoNow do <blink> :)
- handsclean 3y agoThis is also used as a poor man’s live feed: just use this element to reload the page or frame on a set interval.
- SoftTalker 3y agoDrudge Report site still does this, I think. Maybe it's JS now, never checked.
- connordoner 3y agoThis is one of the oldest tricks in the book and was used heavily before WebSockets and similar became mainstream.
- k__ 3y agoI fondly remember html-only iframe chats.
- jchw 3y agoIIRC CGI:IRC had an even more clever version of this: still no JavaScript needed, but Also no refresh needed, as the chat frame response would simply be held open and stream new messages. I never dug too deep into it, but it seemed to work surprisingly well.
- dento 3y agoThis is called Server Sent Events, SSE for short. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...
- disntthinkthis 3y agoThat’s the modern variation. The original didn’t have any framing like they.
- 3y ago
- dmd 3y agoOk, I'll bite - how else do people do this? (Speaking as someone who has ONLY ever done it this way.)
- scarface74 3y agoMost of the time it’s via a server redirect or a rule on the load balancer.
- teh_klev 3y agoOk, how does the server or the load balancer know if scripting is enabled on the first request?
- scarface74 3y agoThe 30x redirect status codes are handle by the browser whether or not scripting is enabled. It is part of the http standard. https://www.rfc-editor.org/rfc/rfc9110#status.301 https://www.rfc-editor.org/rfc/rfc9110#status.301
- teh_klev 3y agoI know this, please read my comment here: https://news.ycombinator.com/item?id=35675861 https://news.ycombinator.com/item?id=35675861
- ssttoo 3y agoThe most common is using an HTTP header. Less common: `document.location` in JavaScript https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirectio...
- tantalor 3y agoThat wouldn't work in a noscript
- javajosh 3y agoI use this trick to autorefresh the resource that I'm working on.
- deleted 3y ago[deleted]
- TRiG_Ireland 3y agoAmazing that these were forgotten!
- gbraad 3y agoI remember once learning that php has a `header` function and have been using 'location:...' since ever (pre-2000) as php was almost always supported by hosters like dreamhost, hostgator, and nearly every Linux install came pre-installed with Apache and the php mod. The meta htttp-equiv was a last resort (like gh-pages). Never really used the JS option unless it was part of the application.
- crooked-v 3y agoThis reminds me of the days of making text adventures that used a width 0 frame to store background variables.
- aendruk 3y agoAh, and next you might discover one of my favorite unresolved browser issues: https://bugs.chromium.org/p/chromium/issues/detail?id=63107 https://bugs.chromium.org/p/chromium/issues/detail?id=63107
- pooper 3y agoI was so sure archive.is/wip/xxxxxx used this but I just checked and it uses <script>{setInterval(function(){document.location.reload();},5000)}</script> now for example, I tried out view-source:https://archive.fo/wip/RpDSg https://archive.fo/wip/RpDSg does anyone else remember seeing meta refresh? if so, any idea why they switched to javascript reload
- bryanrasmussen 3y agowhen they just learned about it was in 2020.
- 9034725985 3y agoI use <meta http-equiv="refresh" content="300"> to do speed test from fast.com see: view-source:https://angularten.github.io/ https://angularten.github.io/
- latchkey 3y agoI remember when it was released as a new feature (~1995).
- moltar 3y agoPutting 0 value used to be a bad idea, as it was a signal to the browser and various ad blockers and anti viruses that it was a rogue redirect. Wonder if it’s different these days?
- masenf 3y agoI've recently deployed this trick on my company's confluence instance (with an HTML macro) to create a "poor man's" link shortener that allows me to change the link target after the fact. Also recently deployed it as a very simple server side denounce: when the client first accesses page X a long running operation is dispatched. Subsequent requests for the same resource before it's done processing return a plain HTML response that says "Still thinking about it" and meta refresh after 1 second.
- deleted 3y ago[deleted]
- kristopolous 3y agoCombining it with the referrer tag and you can make some pretty interesting graphs. With frames you can even do Floyd's algorithm. I made a demo of this about 20 years ago but I think it just confused people. One of my early flops that I thought was cool. It was all in perl and I think there was some JS in there as well but I don't remember anymore. No idea where it is now. Rewrite it and make a hyped up pitch page. People will call you a genius and I'll pretend not to care
- GrumpyNl 3y agoSometimes im flabbergasted on how the most basic html knowledge is lost on newer generations.
- Puts 3y agoThis is what you get if you learn everything by just googling exactly what you need for the moment. Reading proper books and RFCs are underrated these days.
- sgt 3y agoI regularly ask people: have you read the man page? Seems a minimum effort one can do.
- jimmaswell 3y agoThe man page for git has 1085 lines on my system. That's just too long with too much irrelevant information to be reasonable to expect someone to read when they just want one thing. I've never used them in all my time in the industry. ChatGPT is a life saver for me though. I looked all over to try to find how to just see the history of a branch and got a million wrong results, but ChatGPT on GPT4 told me right away it was git log --first-parent <branch_name>.
- krapp 3y agoMost people learned about this stuff by searching the web back in the day, instead of "reading proper books and RFCs." The reason this knowledge is lost is entirely due to modern web dev taking place within frameworks that abstract all that lower-level knowledge away.
- Twisell 3y agoMaybe because we collectively pretty badly handled knowledge transmission between generations. For the pioneers the most difficult part of learning CS was to get hardware needed. This mostly determined the technological stack they would then learn. Nowadays hardware is commodity and the main problem is to determine what the hell you should start learning first because you can't learn everything it has now became humanely impossible. I was born somewhen in the middle. Because of my first field I wish I could have mastered python. But at that time the python2/3 war was at the highest and you couldn't find reliable documentation. Hell even python3 tutorial kept on blabbering about how python2 concept translated. What was i supposed to do? learn both? That is why I focused on SQL because at least documentation was quite stable (special thanks to PostgreSQL documentation teams). I can only imaging the nightmare that must endure rookies frontend dev nowadays.
- fergie 3y agoGoddammit!
- mikece 3y agoThis reminds me that while I’ve been programming for a paycheck since 1998 my knowledge growth in html stopped at about 2001. Are there any good courses or recommendations for seasoned pros who never stopped to learn HTML5?
- onetrickwolf 3y agoWeb development has trained me to Google (now often ChatGPT) everything even if I already know how to do it because it changes so much haha It makes me look stupid in code interviews because I commit very little to memory but professionally it's helped me catch a lot of syntactical upgrades.
- lioeters 3y ago> The term HTML5 is essentially a buzzword that refers to a set of modern web technologies. This includes the HTML Living Standard, along with JavaScript APIs to enhance storage, multimedia, and hardware access. > You may sometimes hear about "new HTML5 elements", or find HTML5 described as a new version of HTML. HTML5 was the successor to previous HTML versions and introduced new elements and capabilities to the language on top of the previous version, HTML 4.01, as well as improving or removing some existing functionality. However, as a Living Standard HTML now has no version. Even though it may cover a lot of basic and familiar topics, I think the following is the best (re)introduction to HTML: HTML: HyperText Markup Language - https://developer.mozilla.org/en-US/docs/Web/HTML https://developer.mozilla.org/en-US/docs/Web/HTML
- jimmaswell 3y ago> The term HTML5 is essentially a buzzword HTML5 is just the common name of the living standard. It's clear, unambiguous, and what everybody uses. It is not a "buzzword".
- lioeters 3y agoI tracked down the Git history where the phrase "essentially a buzzword" was introduced in this pull request: https://github.com/mdn/content/pull/5116/files#diff-7cfca62e1d678c5fb71c3166cdb438e5d72eafe14a321cf0687379cf8d8ce79eR11 https://github.com/mdn/content/pull/5116/files#diff-7cfca62e... I agree that it's unnecessarily dismissive.
- rawbert 3y agoHehe, the good old html meta redirect. As a kid in the early days of the web I loved to post redirects to porn websites in guestbooks to check if the website was sanitizing the user content properly. Worked way to often :D
- Uptrenda 3y agoNoob learns basic HTML tag. The post.