2022.2

Table Of Contents
l
Oneelementthatmatchestheselectorofascriptthatrunsfor"Eachmatchedelement"(see
"this"onpage781and"Settingthescopeofascript"onpage373).
l
Thefirstelementinasetofelementsreturnedbyaqueryinthetemplate(see"query()"on
page742).
html(value)
ReplacestheinnerHTMLofanHTMLelementorofeachelementinaresultsetwiththesupplied
value.
value
AStringthatmaycontainHTMLtags.
Examples
Thefollowingscriptloadspartofasnippetbasedonthevalueofafield,andtheninsertsthecontent
intothedocumentusinghtml().
var promoTxt = loadhtml('snippets/promo-en.html', '#' + record.fields['YOGA']);
results.html(promoTxt);
Thefollowingscriptloadsasnippet.Thenitlooksforaplaceholder(@var2@)inthetextofthatsnippet
andreplaceseveryfoundplaceholderbythetext'<i>OLConnect1</i>'.Ituseshtml()sotheHTML
formatting(<i>and</i>)willindeedbeinterpretedasHTML.Finally,itplacesthesnippetinthetem-
plate.
var mysnippet = loadhtml('snippets/snippet.html');
mysnippet.find('@var1@').html('<i>OL Connect 1</i>');
results.replaceWith(mysnippet);
info()
ReturnspaginationinformationforoneHTMLelementorforthefirstelementinaresultset(see"res-
ults"onpage844)ofaqueryacrossallsectionsinaPrintcontext(see"query(selector)"onpage843).
ThereturnedinformationisofthetypePaginationInfo(see"PaginationInfo"onpage843).
ThisfunctioncanonlybeusedinaPostPaginationScript;see"PostPaginationScriptAPI"on
page840.
Foranexamplesee:"CreatingaTableOfContents"onpage411.
next()
next()returnsthenextsiblingofanHTMLelement,whichcanbe:
Page 801