W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: Proposal: Navigation of JSON documents with html-renderer-script link relation

From: Kris Zyp <kris@sitepen.com>
Date: Fri, 11 Feb 2011 07:40:01 -0700
Message-ID: <4D554A41.1010900@sitepen.com>
To: Julian Reschke <julian.reschke@gmx.de>
CC: WebApps WG <public-webapps@w3.org>
On 2/11/2011 7:15 AM, Julian Reschke wrote:
> On 11.02.2011 14:48, Kris Zyp wrote:
>> Increasingly, web applications are centered around JSON-based content,
>> and utilize JavaScript to render JSON to HTML. Such applications
>> (sometimes called single page applications) frequently employ changes to
>> the hash portion of the current URL to provide back/forward navigation
>> and bookmarkability. However, this is largely viewed as an awkward hack,
>> and is notoriously problematic for search engines (Google has a hash to
>> query string conversion convention, which is also highly inelegant). We
>> need support for first class navigation of JSON documents, while still
>> leveraging HTML rendering technology.
>> ...
>
> Sounds very interesting.
>
> Did you consider making the link point to an HTML(+Script) page, and
> placing the JSON object into that pages script context somehow?

Yes, I had considered that. However, I believe that most webapps that
would use this API would be doing mostly JavaScript based rendering, in
which case the HTML just seems to add an extra layer of indirection for
loading a script. I would think most applications would want to get a
script loaded right away, so I wrote the proposal based on that use
case. That being said, I have no strong objection to having the JSON
response link to an HTML page instead of a script. Loading HTML could
possibly make it easier to reason about the order and timing of multiple
script loads.

>
> Or maybe even XSLT (all we'd need was a standard to-XML mapping).

Yes, although my proposal dealt with JSON (although the same
API/approach could be applied to XML documents) which doesn't apply to
XSLT, and there isn't a single transform/templating standard for JSON.
There are numerous JSON templating libraries out there, but by loading a
script, an author can easily load their favorite JSON templating library
and perform the tranformation (to HTML). If one templating engine really
become popular, it seems like it could be reasonable to have direct
support for that in the browser someday (with maybe a
"html-renderer-mustache" relation, for example), although personally I'd
prefer something more CSS like to describe the presentation of JSON. The
door is wide open for future relations and handlers.
Thanks,
Kris
Received on Friday, 11 February 2011 14:40:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:43 GMT