Re: JSON imports?

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