W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: JSON imports?

From: Erik Isaksen <nevraeka@gmail.com>
Date: Fri, 24 Apr 2015 22:00:27 +0000
Message-ID: <CA+owcomr21nnyHrrMpz4udwTt5s2x-H7NQoiDLBANKd8yKOuxw@mail.gmail.com>
To: Matthew Robb <matthewwrobb@gmail.com>, Glen Huang <curvedmark@gmail.com>
Cc: public-webapps <public-webapps@w3.org>
Would be nice to have this. We only have imperative ways to grab JSON (that
is verified as JSON) . This would give a built in way to grab JSON data. I
do agree with Wilson that we can do this with custom elements but I think
this is much more suited to be a native element or extension of script.

maybe :
<import type="application/json" src="foo.json"></import>

On Fri, Apr 24, 2015 at 5:54 PM Matthew Robb <matthewwrobb@gmail.com> wrote:

> I like the idea of this. It reminds me of polymer's core-ajax component.
> On Apr 16, 2015 11:39 PM, "Glen Huang" <curvedmark@gmail.com> wrote:
>
>> Inspired by HTML imports, can we add JSON imports too?
>>
>> ```html
>> <script type="application/json" src="foo.json" id="foo"></script>
>> <script type="application/json" id="bar">
>> { "foo": "bar" }
>> </script>
>> ```
>>
>> ```js
>> document.getElementById("foo").json // or whatever
>> document.getElementById("bar").json
>> ```
>>
>>
Received on Friday, 24 April 2015 22:24:03 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC