2018.1

Table Of Contents
var post = loadhtml('snippets/post.rhtml');
var h1 = query('h1', post).text();
results.text(h1);
Another example is given in the following how-to: Using a selector to load part of a snippet.
loadjson()
Creates a JSON object based on the text retrieved fromthe suppliedlocation. The function lets
you retrieve content from a JSON enabled server using a standard HTTP request. Popular
content management systems, like WordPress (requires JSON API plugin) and Drupalprovide
a JSON service/API to retrieve content.
Note
Loadjson() is cached per batch run (based on the URL) in print/email.
This online JSON viewer is handy to debug JSON data: http://jsonviewer.stack.hu
loadjson(location)
Loads json data from the specified location.
location
String; the supplied location should be either a URL or a relative filepath. The file protocol
is supported as well as the http/https protocols. The complete syntax of a fully qualified
URL with the "file" protocol is: file://<host>/<path>. If the host is "localhost", it can be omitted,
resulting in file:///<path>, for example: file:///c:/somefolder/somejson.json.
Examples
This sample script retrieves JSON data from a snippet.
var localJSON = loadjson('snippets/jsonsnippet.json');
if(localJSON.post){
results.html("<h3>" + localJSON.post.title + "</h3><p>" +
localJSON.post.modified + "</p>");
}
This script retrieves a post from a WordPress site.
Page 1070