2022.2

Table Of Contents
Note:
l
ThespecifiedHTMLfileisexpectedtobeUTF-8encoded.
l
Loadhtml()iscachedperbatchrun(basedontheURL)inprint/email.
Tip: ToloadaJavaScriptfile(.js)orastylesheet(.css)youcanuseloadtext().See"loadtext
()"onpage731.
Tip: Externalcontentisnotloadedwhileeditingascript.Totestascriptthatloadsexternalcon-
tent,youcandoapreflight;see"DoingaPreflight"onpage378.
loadhtml(location)
LoadsallHTMLfromthespecifiedHTMLfile.
location
Stringcontainingapaththatcanbeabsoluteorrelativetothesection/context.
Usesnippets/<snippet-name>toretrievethecontentfromanHTMLfileresidingintheSnippets
folderontheResourcespanel.
Inordertoretrievefilesfromoutsidethetemplatethefileprotocolissupportedaswellasthe
http/httpsprotocols.
ThecompletesyntaxofafullyqualifiedURLwiththe"file"protocolis:file://<host>/<path>.Ifthehostis
"localhost",itcanbeomitted,resultinginfile:///<path>,forexample:file:///c:/-
somefolder/somecontent.html.
Whenusingthehttp/httpsprotocol,rememberthatonlyabsolutepathsaresupportedinsideremote
snippets(see"Remotesnippets"onpage251).
Tip: ToquicklygetthelocationofanHTMLsnippetinthetemplateresources,right-clickthesnip-
petintheResourcespaneandselectCopy Resource Location.
ThepathtoaremoteHTMLsnippetcanbecopiedfromthesnippet'sproperties:right-clickthe
snippetintheResourcespaneandselectProperties.
Examples
ThisscriptloadsalocalHTMLsnippet(fromtheResourcespanel)directlyintothematchedelements
results.loadhtml("snippets/snippet.html");
Page 726