Live data from Hacker News

I just learned about HTML redirects (2020)

apitman.com

21–30 of 88 posts

Re: I just learned about HTML redirects (2020)

#21
post #17
post #13

Ok, I'll bite - how else do people do this? (Speaking as someone who has ONLY ever done it this way.)

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

Re: I just learned about HTML redirects (2020)

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

Re: I just learned about HTML redirects (2020)

#26

This is also used as a poor man’s live feed: just use this element to reload the page or frame on a set interval.

This is one of the oldest tricks in the book and was used heavily before WebSockets and similar became mainstream.

I fondly remember html-only iframe chats.

Re: I just learned about HTML redirects (2020)

#29
post #19
post #4

Earlier quoted context omitted.

Not 'official' and yet supported by all major browsers to this day.

It is official.

My bad. I was thinking of the refresh header, not the HTML meta refresh. The header I believe is not official but nevertheless supported by many browsers since Netscape Navigator. In PHP:

header("Refresh:; url=");

Re: I just learned about HTML redirects (2020)

#30
post #26

Earlier quoted context omitted.

This is one of the oldest tricks in the book and was used heavily before WebSockets and similar became mainstream.

I fondly remember html-only iframe chats.

IIRC 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.
Post reply on HN