2020.2

Table Of Contents
Note
l The specified HTML file is expected to be UTF-8 encoded.
l Loadhtml() is cached per batch run (based on the URL) in print/email.
Tip
To load a JavaScript file (.js) or a style sheet (.css) you can use loadtext(). See
"loadtext()" on page1286.
Tip
External content is not loaded while editing a script. To test a script that loads external
content, you can do a preflight; see "Doing a Preflight" on page865.
loadhtml(location)
Loads all HTML from the specified HTML file.
location
String 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 "Remote snippets" on page723).
Tip
To quickly get the location of an HTML snippet in the template resources, right-click the
Page 1282