RIP SEO
Not really, Google and Bing will read the page correctly with Javascript. Check the page insight: https://developers.google.com/speed/pagespeed/insights/?url=... But it would be even better if they could get the information directly on JSON. So much carbon saved ;)
Show HN: This website is valid JSON
101–110 of 240 posts
Re: Show HN: This website is valid JSON
#102This is a really cool hack. > The JSON must contain only pure information without any concern about design or markup. Wellll.. I mean the json has markdown syntax in it. That's a lot nicer than html tags for markup, but it's still markup. In case anyone reading hasn't seen it before, browsers have a thing called XSLT built into them that does something similar for XML documents. You serve up your data as XML, add a t…
XSLT is the only way to do HTML templating on the client without using JS. I think that is valuable.
Re: Show HN: This website is valid JSON
#103Hello everyone, I created a simple script that allows a website to be a valid JSON and still be able to present the information on the browser. Any feedback is appreciated!
Re: Show HN: This website is valid JSON
#104This is a really cool hack. > The JSON must contain only pure information without any concern about design or markup. Wellll.. I mean the json has markdown syntax in it. That's a lot nicer than html tags for markup, but it's still markup. In case anyone reading hasn't seen it before, browsers have a thing called XSLT built into them that does something similar for XML documents. You serve up your data as XML, add a t…
> Apparently web standards folks in the early 2000s thought the future was XML all the way down. It should have been, but just like the masses rejected LISP for its parens, the masses rejected XML for the closing tag. We could have avoided PHP and the zoo of MVC frameworks.
Re: Show HN: This website is valid JSON
#105For those like me who needed a little help... I do not fully understand the browser rendering process (someone who does please chime in), but what I gather about how this is works is: - the content-type of the page is "text/html", so the browser is trying to render html - there is no special meaning of the #render key to the browser (again the browser doesn't know this is json) - browsers are very fault tolerant so t…
In regards to the character encoding issue, I wonder if they could just move the #render to the top of the object by inserting it as the first property.
Re: Show HN: This website is valid JSON
#106Earlier quoted context omitted.
I still have nightmares from learning XSLT. It's very cool, but also, very strange, if you come from a procedural language background. Also, XSLT is really given power by being mixed with XPath (which is procedural). I suspect that if I had known more about FP back when I learned it, I would have had an easier time. I wrote up a really long, painful post about XSLT, way back in the early 'oughts.
XSLT is mainly used to transform XML into XML. The resulting document doesn’t have to be XML, though. I remember being assigned a task of parsing and importing a large XML document into a MySQL database. This was supposed to be done on PHP. I kind of felt repulsed by the idea of writing the parser in PHP (it would have been horrible). So, I used XSLT to transform the document into CSV and then just imported it using…
It was pain and suffering developing these style sheets, but once done it worked like a charm.
Re: Show HN: This website is valid JSON
#107This is a really cool hack. > The JSON must contain only pure information without any concern about design or markup. Wellll.. I mean the json has markdown syntax in it. That's a lot nicer than html tags for markup, but it's still markup. In case anyone reading hasn't seen it before, browsers have a thing called XSLT built into them that does something similar for XML documents. You serve up your data as XML, add a t…
> Apparently web standards folks in the early 2000s thought the future was XML all the way down. It should have been, but just like the masses rejected LISP for its parens, the masses rejected XML for the closing tag. We could have avoided PHP and the zoo of MVC frameworks.
Re: Show HN: This website is valid JSON
#108For those like me who needed a little help... I do not fully understand the browser rendering process (someone who does please chime in), but what I gather about how this is works is: - the content-type of the page is "text/html", so the browser is trying to render html - there is no special meaning of the #render key to the browser (again the browser doesn't know this is json) - browsers are very fault tolerant so t…
In regards to the character encoding issue, I wonder if they could just move the #render to the top of the object by inserting it as the first property.
Re: Show HN: This website is valid JSON
#109For those like me who needed a little help... I do not fully understand the browser rendering process (someone who does please chime in), but what I gather about how this is works is: - the content-type of the page is "text/html", so the browser is trying to render html - there is no special meaning of the #render key to the browser (again the browser doesn't know this is json) - browsers are very fault tolerant so t…
You are correct. It's a silly hack. Just because it happens to work doesn't make it a good idea. Turn off JavaScript and you just get JSON text.
# Markdown header
## Subheader
### Section header
1. Numbered
1. List
- Unordered
- List
[//]: # (var doc = document.children[0].textContent.split('\n'); md = doc.slice(0, doc.length - 1).join("\n"); document.body.innerHTML = marked(md);
That last line has varying degrees of invisibility in different markdown viewers I looked at.
Obviously there's optimization that could be had here but this is equally hacky IMO and simpler since you can just write MD instead of JSON. You lose a couple of key features though -- templated components for example. However, I imagine you could shoehorn those in without much effort.This has the advantage that without JS enabled you'll get poorly formatted markdown in the browser.
Re: Show HN: This website is valid JSON
#110Earlier quoted context omitted.
Hey! Yes, however now I notice that this is only when running locally. I took your page, replaced script and css with absolute links, and loaded locally as file://
hmm, I didn't find this error locally either. I will try using file://. Thanks for the report. Also, if you are interested, the project is on GitHub: https://github.com/webdatarender
In particular browsers tend to be a lot more enthusiastic about treating local files as unicode than they are for responses from web servers.
The reason the meta charset doesn't pick up is you're missing quotes around `utf-8` (also it may be past the 1024 byte mark, hard to say without running wc).