Public Method Author API

domSelector

Specifies the DOM selector where the authoring interface rendered by Author API is injected.

Important An empty container element must be placed on the page with a unique ID where the authoring interface will be rendered.

Examples

<!-- Example 1: On the page, add a <div> container with a unique ID where the authoring interface will be rendered, pass to init() along with a `callbacksObject` -->
<div id="my-authoring-interface-container"></div>

<script>
    // When init() is called, the authoring interface will be injected
    // into the container with ID 'my-authoring-interface-container' on the page
    window.LearnosityAuthor.init(
        initializationObject,
        callbacksObject,
        '#my-authoring-interface-container'
    );
</script>

<!-- Example 2: On the page, add a <div> container with a unique ID where the authoring interface will be rendered, pass to init() but omit `callbacksObject` if it's not required -->
<div id="my-authoring-interface-container"></div>

<script>
    window.LearnosityAuthor.init(
        initializationObject,
        '#my-authoring-interface-container'
    );
</script>

<!-- Example 3: On the page, add a <div> container with the default ID (so no need to pass `domSelector` to init()) -->
<div id="learnosity-author"></div>

<script>
    // When init() is called, the authoring interface will be injected
    // into the container with ID 'learnosity-author' on the page
    // Note no string (nor callbacks) are passed here.
    window.LearnosityAuthor.init(
        initializationObject
    );
</script>
Was this article helpful?