2020.2

Table Of Contents
section or Master Page with elements retrieved from a Content Management system, before
Standard Scripts run.
html()
Gets the initial contents of the <body> of a section or Master Page.
html(value)
Replaces the contents of the <body> of a section or Master Page with the supplied value. This
function is only available in Control Scripts. See also: "section" on page1426 and
"masterpage" on page1383.
value
A String that may contain HTML tags.
Examples
The following script uses html() to retrieve the contents of a section and add a paragraph to it.
var foo = merge.context.sections["Section 1"].html();
foo += "<p>hello world</p>";
merge.context.sections["Section 1"].html( foo );
The following script loads a snippet based on the value of a field, and then replaces the content
of a Print section with the snippet using html().
var mySection = merge.context.sections["Section 1"];
var promoTxt = loadhtml('snippets/promo-' + record.fields['City'] +
'.html');
mySection.html(promoTxt);
paginate()
This method of the section object (see "section" on page1426) triggers pagination of the
current section. The pagination process re-establishes page boundaries, updates page
numbers and page counts, and reapplies Master Pages.
Depending on whether page numbering restarts in each section this may affect the page
numbers in other sections as well (see "Configuring page numbers" on page481).
When the pagination process has ended, the script resumes.
Page 1408