Live data from Hacker News

Show HN: This website is valid JSON

webdatarender.com

1–10 of 240 posts

Re: Show HN: This website is valid JSON

#4
post #2

Hello 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!

Is the initiator documented anywhere? How come the browser uses it to draw the page?

Re: Show HN: This website is valid JSON

#5
post #2

Hello 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!

Looks great, reminds me of jasonette http://jasonette.com/. Good luck with your blogging platform!

Re: Show HN: This website is valid JSON

#6
post #4
post #2

Hello 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!

Is the initiator documented anywhere? How come the browser uses it to draw the page?

yes, the initiator is a valid HTML with a `` pointing to the script that receives the JSON and render the page. The interesting part is you can `fetch` the page directly and it will respond a valid JSON.

Re: Show HN: This website is valid JSON

#7
post #2

Hello 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!

Looks great, reminds me of jasonette http://jasonette.com/ . Good luck with your blogging platform!

Thanks, appreciated! About the jasonette, WDR is not a markup language. Actually it is the opposite. It tries to not use markup on the data but put everything related to the design and markup inside the render.

Re: Show HN: This website is valid JSON

#8
post #4
post #2

Hello 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!

Is the initiator documented anywhere? How come the browser uses it to draw the page?

While the source looks like JSON, the page is still sent by the server as text/html. Browsers are so resilient to malformed markup that actually parse the content inside the tag at the end of the document (firing the JS script that render the actual page), ignoring all the (pseudo) JSON around.

The page is rendered in QUIRKSMODE because the source is missing the at the beginning of the document, to resemble valid JSON.

Well, at least that's clever!

Re: Show HN: This website is valid JSON

#9
I'm confused about:

> The JSON must contain only pure information without any concern about design or markup. All the design and markup required to render the page must be inside the rendering script.

The source code has markup in the form of Markdown, e.g. ## or * text

Re: Show HN: This website is valid JSON

#10
This 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 tag that points to an XSLT document, and the browser will use the transform on your document automatically. If the resulting output is renderable XHTML, it'll display it like a regular webpage.

That being said, I wouldn't recommend doing that, since XSLT is a programming language whose syntax is XML itself. Apparently web standards folks in the early 2000s thought the future was XML all the way down.

Post reply on HN