16.9.7.2 Locating JavaScript code for drop-down sections

By default, for most output types DITA2Go inserts JavaScript code for drop-down sections in the <head> section of each HTML file that contains one or more drop-down sections. For OmniHelp, DITA2Go includes the JavaScript code in viewer files ohctrl.js and ohmain.js. For any output type, you can direct DITA2Go to reference the code in a separate JavaScript library instead.

To specify where the JavaScript code resides:

[DropDowns]
; DropJSLocation = Head (to insert the code in <script> tags),
; None (if the code is included elsewhere, as for OmniHelp),
;  or a filename to reference in a JS link in the <head>.
DropJSLocation = Head

When DropJSLocation=Head, DITA2Go places JavaScript code in the <head> section of each output HTML file that includes at least one drop-down section:

<script language="JavaScript" type="text/javascript">
<!--
<$DropJS>
//-->
</script>

Macro $DropJS is expanded when DITA2Go writes the output HTML file.

When DropJSLocation=None, DITA2Go assumes you are supplying a JavaScript library for which a reference already exists, possibly configured as part of a value for Head in the [Inserts] section. See §37.9.2 Invoking macros at predetermined points in output.

When DropJSLocation=filename, DITA2Go places the following reference in the <head> section:

<script language="JavaScript" type="text/javascript"
src="<$DropJSLocation>"></script>

Macro $DropJSLocation is expanded when DITA2Go writes the output HTML file. The file specification you provide for filename can include a path relative to the project directory. Although you can specify an absolute path, we advise against it. Also, a path that includes a drive specification will not work.

Previous Topic:  16.9.7.1 Naming the JavaScript macro for drop-down sections

Next Topic:  16.9.7.3 Directing DITA2Go to write drop-down JavaScript code

Parent Topic:  16.9.7 Deploying JavaScript code for drop-down sections

Sibling Topics:

16.9.7.1 Naming the JavaScript macro for drop-down sections

16.9.7.3 Directing DITA2Go to write drop-down JavaScript code

16.9.7.4 Inspecting the JavaScript code for drop-down sections

Table of ContentsIndex