Re: JSON imports?

One benefit is that browsers can start downloading it asap, instead of waiting util the fetch code is executed (which could itself be in a separate file).

> On Apr 18, 2015, at 8:41 AM, Elliott Sprehn <esprehn@chromium.org> wrote:
> 
> 
> 
> On Fri, Apr 17, 2015 at 6:33 AM, Glen Huang <curvedmark@gmail.com <mailto:curvedmark@gmail.com>> wrote:
> Basic feature like this shouldn't rely on a custom solution. However, it does mean that if browsers implement this, it's easily polyfillable.
> 
> What does this get you over fetch() ? Imports run scripts and enforce ordering an deduplication. Importing JSON doesn't really make much sense.
> 
> 
>> On Apr 17, 2015, at 9:23 PM, Wilson Page <wilsonpage@me.com <mailto:wilsonpage@me.com>> wrote:
>> 
>> Sounds like something you could write yourself with a custom-elements. Yay extensible web :)
>> 
>> On Fri, Apr 17, 2015 at 1:32 PM, Matthew Robb <matthewwrobb@gmail.com <mailto: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 <mailto: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 Saturday, 18 April 2015 02:08:27 UTC