Re:Show HN: This website is valid JSON
by CGamesPlay on Tuesday December 08, 2020 @11:30PM
(#25355374)
Here's one that works without JavaScript, you curmudgeon:
You can paste this directly into your URL bar, and view source to see the valid JSON document.
[ Parent
| on HN ]
Re:Show HN: This website is valid JSON
by Arnavion on Wednesday December 09, 2020 @04:18AM
(#25356775)
It's a valid JSON document that's basically unrelated to the HTML that ends up being displayed, so it's not exactly equivalent to the submitted link.
What the submitted link achieves is impossible without JS, which is also why it's a cute hack and should only be used in production with the knowledge that it's not going to work well for clients without JS.
Re:Show HN: This website is valid JSON
by quickthrower2 on Wednesday December 09, 2020 @04:29AM
(#25356830)
Check out my search engine:
data:text/html;charset=utf-8,<meta http-equiv="refresh" content="0;url=http://google.com/" />
And now you can no longer read it with a json reader, which I assume was the motivation for the hack to begin with.