Javascript: TextFrameCollection.remove Method
Description
Removes a text frame from a Text Control document.
Syntax
<void> TextFrameCollection.remove(<TextFrame> text, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| text | frame - Specifies the text frame to remove. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TextFrameCollection.remove in a practical document-editing workflow. It removes a text frame from a Text Control document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function remove(text) {
TXTextControl.textFrames.remove(
text,
function() {
console.log("remove completed.");
},
onTxError
);
}