2019.1

Table Of Contents
This script retrieves multiple posts from a WordPress site.
var numPosts = 3;
var wpPost = '';
var wpRecentPosts = loadjson('http://192.168.101.58/?json=get_
recent_posts&count=' + numPosts);
if(wpRecentPosts.posts){
for (var i = 0; i < numPosts ; i++) {
wpPost += "<p>" + wpRecentPosts.posts[i].title + "</p>";
}
}
results.after(wpPost)
loadtext()
Loads text from the specified text file, for example a JavaScript file (.js) or style sheet (.css).
The text file may be located inside the template or hosted on a Content Management System or
on another location outside the template.
Tip
To load an HTML fragment, you can use use loadhtml() (see
Skin/Formats/CrossReferencePrintFormat("loadhtml()Loads HTML content from the specified
HTML file. The file may be located inside the template (see
Skin/Formats/CrossReferencePrintFormat("Snippets" on page1)) or hosted on a Content
Management System or on another location outside the template.An optional selector allows you to
retrieve only the content of matching elements.Loadhtml() is cached per batch run (based on the
URL) in print/email.To load a JavaScript file (.js) or a style sheet (.css) you can use loadtext(). See
Skin/Formats/CrossReferencePrintFormat("loadtext()" on page1).External content is not loaded
while editing a script. To test a script that loads external content, you can do a preflight; see
Skin/Formats/CrossReferencePrintFormat("Doing a Preflight" on page1).loadhtml(location)Loads
all HTML from the specified HTML file.locationString containing a path that can be absolute or
relative to the section/context. Use snippets/<snippet-name> to retrieve the content from an HTML
file residing in the Snippets folder on the Resources panel.In order to retrieve files from outside the
template 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/somecontent.html.When
using the http/https protocol, remember that only absolute paths are supported inside remote snippets
(see Skin/Formats/CrossReferencePrintFormat("Remote snippets" on page1)).ExamplesThis script
loads a local HTML snippet (from the Resources panel) directly into the matched
elementsresults.loadhtml("snippets/snippet.html");The following script loads a local HTML snippet
Page 1272