moveInstanceTo - Methods - Author API

Author API Methods

moveInstanceTo()

Moves the Author API instance into the specified DOM element.

You would want to use this method so that you can re-render the visual elements in the browser and relocate the Author API instance, for example.

Examples

// Standard usage where the UI has been successfully moved
var element = document.getElementById('author-api-container');
var moveResult = authorApp.moveInstanceTo(element);
console.log(moveResult);

// Returns false where the target DOM element doesn't exist
var element = document.getElementById('non-existing-element');
var moveResult = authorApp.moveInstanceTo(element);
console.log(moveResult);

Arguments

  • element object

    The DOM element to append the Author API instance to.

Return value

Type boolean

Returns true if successful, or false if unable to move the Author API instance to the provided element.

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.