I’d like this idea, especially when native JSON loading is combined with 
JSONPath (if possibly provided by standard 
http://goessner.net/articles/JsonPath/ ), e.g. I have a large JSON formatted 
content served by server:
  Content-Type: application/json
  {
      brief: {
          // 10 properties
      }, /* This is a stop-point */
      // other 100+ properties, over 2MB in size
  }
Once native JSON loading is suppoted, when I load a uri with JSONPath such as 
./api/info.json#brief, would it be possible that user agent streamed this 
response, read until the close of *brief* property (The stop-point in code 
example), then close this connection (or other ways to notify server that 
remaining content is not required), this would (in some case) be benefit for 
network performance.

Gray Zhang
Mail: [email protected]
Blog: http://www.otakustay.com
Weibo: http://www.weibo.com/otakustay

From: Wes Garland 
Sent: Friday, March 09, 2012 1:42 AM
To: David Bruant 
Cc: es-discuss 
Subject: Re: Native JSON loading (was: system module loader)

> What about native JSON loading?

How would this be different from XHR + JSON.parse() sugar?

Are you proposing loading the JSON from the server as though it were a module?

FWIW, most of my JSON-loading use cases are post-page-load, they are of the 
"fetch some data from the server based on user input" variety.

In a very very very small number of cases (session state mostly) I also will 
load data at the same time as page load; for these cases I currently use SCRIPT 
tags and code ~ like this on the server

print("Content-type: application/x-javascript\n")
/* do stuff */
print "var o = " + uneval(o);

Wes

-- 
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102



--------------------------------------------------------------------------------
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to