Live data from Hacker News

I just learned about HTML redirects (2020)

apitman.com

71–80 of 88 posts

Re: I just learned about HTML redirects (2020)

#71

I 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.

It would be nice to see a collection of "dated" or "usually forgotten" web tools like this, and how they can still be useful.

Re: I just learned about HTML redirects (2020)

#73
post #72

This 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?

Web 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.

Re: I just learned about HTML redirects (2020)

#74
post #17

Earlier quoted context omitted.

The most common is using an HTTP header. Less common: `document.location` in JavaScript https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirectio...

That wouldn't work in a noscript

Therefore the method called "progressive enhancement" might be an option to start with an HTML-only variant and load JS only if available and required for the current page.

Re: I just learned about HTML redirects (2020)

#75

Earlier quoted context omitted.

The noscript tag is the correct way to do this. Server side, when you first generate page content you have no idea if the client has scripting enabled, which is why you include a noscript element to advise the user what to do, or redirect them using a meta tag inside the noscript element. So all these suggestions below to use server side generated HTTP headers and 302 (or 301) redirects are incorrect...because you wo…

> So all these suggestions below to use server side generated HTTP headers and 302 (or 301) redirects are incorrect...because you won't know, on the first page hit, if the client has scripting enabled. Perhaps I’m misunderstanding you, but do you think that the HTTP approach only works when JavaScript is enabled? That isn’t the case. Go ahead and use HTTP 3xx responses; they work in all cases. Don’t use the element o…

Ok, in the context of the article, what I'm saying is when a browser requests a page for the very first time, the server will have no idea if scripting is enabled and so your server side code will have no idea whether to send a 302 redirect to your no-script content.

This is why the noscript tag exists and should be used.

Yes I'm aware there are various sniffing techniques you could use to work out if scripting is enabled but these are not always reliable. Only the browser knows authoritatively if scripting is available and hence you should use the noscript element to respond to clients that disabled scripting.

Re: I just learned about HTML redirects (2020)

#76
post #58
post #42

Earlier quoted context omitted.

controversial opinion, frames were awesome...for some things

I got PTSD... then again, a lot of things were wrong about that system. GET requests casually loading up whole database in memory while calling stored procedures that inexplicably modify like half of persisted version of it. and that's just to render some stupid list o_0

agreed, I help make Chemistry World with a chemist that had a cool 3d .mol viewer with frames back in the day when 3d was pretty fancy :)

Re: I just learned about HTML redirects (2020)

#78
post #72

This 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?

> 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

Post reply on HN