2018.1

Table Of Contents
html += '</ul>';
results.after(html);
See WordPress REST API developer endpoint reference.
Tip
More examples of how to use an API to load external content are given in these How-to's:
l Using the Google Maps API
l Using the OpenWeatherMap API
Control Scripts
When output is generated from a template, Control Scripts run before all other scripts, when a
record is merged with a context. They determine how different sections of the context are
handled. They can, for example, make the page numbering continue over all Print sections,
split Email attachments, or omit Print sections from the output.
Some knowledge of JavaScript is needed to edit Control Scripts, just as for any other self-made
scripts, because there is no Control Script Wizard; see "Writing your own scripts" on page689.
This topic explains how to add a Control Script and it gives an overview of what Control Scripts
can do. It will also tell you where you will find information about each feature, including
examples.
What Control Scripts are
Control Scripts are a special kind of Designer script. They can manipulate the way output is
generated from a template. They allow you, for example, to change the page numbering in Print
output, to split one generated Print document into multiple Email attachments, or to set a Print
section's background dynamically. (These are only a few examples; for more uses of Control
Scripts see "What to use a Control Script for" on the facing page.)
Control Scripts differ from template scripts in two ways:
l Control Scripts run before all other scripts. When a template consists of several contexts,
and these contexts are combined in the output - for example, when an Email is generated
Page 711