# Javascript: FrameBase.setLocation Method

> Sets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FrameBase.setLocation Method
- **512 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setlocation-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setlocation-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setlocation-method/llms-full.txt

---

### Description

Sets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline.

### Syntax

```javascript
<void> FrameBase.setLocation(<Point> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| value | The new property value. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FrameBase.setLocation` in a practical document-editing workflow. Sets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function configureLocation(frameBase) {
    frameBase.setLocation(
        { x: 1440, y: 720 },
        function() {
            console.log("set location completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FrameBase.setInsertionMode Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setinsertionmode-method/llms-full.txt)
- **Next:** [Javascript: FrameBase.setMoveable Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/setmoveable-method/llms-full.txt)
